public final class TlsHelper extends Object
SSLContext.
Currently only supports client-side
System.setProperty(TlsSystemConfig.TLS_ENABLE, "true");
System.setProperty(TlsSystemConfig.TLS_ENABLE, "true"); System.setProperty(TlsSystemConfig.CLIENT_AUTH, "true"); System.setProperty(TlsSystemConfig.CLIENT_TRUST_CERT, "trustCert");
public static SSLContext buildSslContext(boolean forClient) throws NoSuchAlgorithmException, KeyManagementException
org.apache.http.ssl.SSLContexts.
For example
HttpsURLConnection.setDefaultSSLSocketFactory(TlsHelper.buildSslContext(true).getSocketFactory());forClient - whether for clientSSLContextNoSuchAlgorithmException - Not support the specified algorithmKeyManagementException - KeyManagement exceptionCopyright © 2018–2020 Alibaba Group. All rights reserved.