Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
1.5.1-RC
-
None
Description
The provided enabledSslCipherSuites in org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.enabledSslCipherSuites(SSLSocket sslSocket) is compared against sslSocket.getEnabledCipherSuites() instead of sslSocket.getSupportedCipherSuites(). This will always fail if you want to enable a new CipherSuite not in the current enabled cipher list.
The enabledSslProtocolSuites is implemented correctly by comparing against sslSocket.getSupportedProtocols().
This functionality is Critical for enabling TLS 1.2 protocol and ciphers on Java 7 to connect to Mariadb
protected void enabledSslCipherSuites(SSLSocket sslSocket) throws QueryException {
if (options.enabledSslCipherSuites != null) {
List<String> possibleCiphers = Arrays.asList(sslSocket.getEnabledCipherSuites());
String[] ciphers = options.enabledSslCipherSuites.split("[,;\\s]+");
for (String cipher : ciphers) {
if (!possibleCiphers.contains(cipher))
}
sslSocket.setEnabledCipherSuites(ciphers);
}
}
protected void enabledSslProtocolSuites(SSLSocket sslSocket) throws QueryException {
if (options.enabledSslProtocolSuites == null) {
sslSocket.setEnabledProtocols(new String[]
);
} else {
List<String> possibleProtocols = Arrays.asList(sslSocket.getSupportedProtocols());
String[] protocols = options.enabledSslProtocolSuites.split("[,;\\s]+");
for (String protocol : protocols) {
if (!possibleProtocols.contains(protocol))
}
sslSocket.setEnabledProtocols(protocols);
}
}