Skip to content

Commit 069af7c

Browse files
committed
do not allow cipher suite list to be overridden when creating context
1 parent b3daca0 commit 069af7c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/java/com/wolfssl/provider/jsse/WolfSSLContext.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,16 @@ private void createCtx() throws WolfSSLException {
161161
() -> "created new native WOLFSSL_CTX");
162162

163163
if(ctxAttr.list != null && ctxAttr.list.length > 0) {
164+
/* User overrode cipher suite list via WolfSSLCustomUser */
164165
ciphersIana = ctxAttr.list;
165-
} else {
166-
ciphersIana = WolfSSL.getCiphersIana();
167166
}
167+
/* Otherwise keep version-specific ciphers from
168+
* getCiphersAvailableIana() above. Do not fall back to
169+
* getCiphersIana() which returns ALL cipher suites regardless of
170+
* protocol version. Mixing TLS 1.3 and pre-TLS 1.3 cipher suites
171+
* causes issues with wolfSSL cipher list parsing when using
172+
* version-specific methods (TLSv1_2_Method, etc.) which have
173+
* downgrade disabled. */
168174

169175
/* Set minimum allowed RSA/DH/ECC key sizes */
170176
enforceKeySizeLimitations();

0 commit comments

Comments
 (0)