Skip to content

Commit

Permalink
fix ssl enabled protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldbread3 committed Mar 31, 2022
1 parent 5d7304e commit 2fe3dac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected static byte[] parseFileContent(byte[] pem, String beginDelimiter, Stri
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,
Expand Down

0 comments on commit 2fe3dac

Please sign in to comment.