Skip to content
Snippets Groups Projects
Commit 2fe3dac5 authored by chenmo.cm's avatar chenmo.cm
Browse files

fix ssl enabled protocol

parent 5d7304e8
No related branches found
Tags galaxysql-5.4.13
No related merge requests found
......@@ -41,7 +41,7 @@ public class SslConstant {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, null, null);
sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket();
String[] enabledProtocols = sslSocket.getEnabledProtocols();
enabledProtocols = sslSocket.getEnabledProtocols();
if (enabledProtocols != null && enabledProtocols.length > 0) {
String enabledProtocol = enabledProtocols[0];
PROTOCOL = enabledProtocol;
......
......@@ -214,7 +214,7 @@ public final class SslContextFactory {
String data = new String(pem);
String[] tokens = data.split(beginDelimiter);
tokens = tokens[1].split(endDelimiter);
return Base64.getDecoder().decode(tokens[0]);
return Base64.getDecoder().decode(tokens[0].replaceAll("[\r\n]", ""));
}
protected static RSAPrivateKey generatePrivateKeyFromDER(byte[] keyBytes) throws InvalidKeySpecException,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment