类 TlsHelper
java.lang.Object
com.alibaba.nacos.common.tls.TlsHelper
Utils for build
SSLContext.
Currently only supports client-side
Making your client support TLS without authentication
System.setProperty(TlsSystemConfig.TLS_ENABLE, "true");
Making your client support TLS one-way authentication
System.setProperty(TlsSystemConfig.TLS_ENABLE, "true"); System.setProperty(TlsSystemConfig.CLIENT_AUTH, "true"); System.setProperty(TlsSystemConfig.CLIENT_TRUST_CERT, "trustCert");
- 作者:
- wangwei
-
构造器概要
构造器 -
方法概要
-
构造器详细资料
-
TlsHelper
public TlsHelper()
-
-
方法详细资料
-
buildSslContext
public static SSLContext buildSslContext(boolean forClient) throws NoSuchAlgorithmException, KeyManagementExceptionReturns aSSLContexts.For example
HttpsURLConnection.setDefaultSSLSocketFactory(TlsHelper.buildSslContext(true).getSocketFactory());- 参数:
forClient- whether for client- 返回:
SSLContext- 抛出:
NoSuchAlgorithmException- Not support the specified algorithmKeyManagementException- KeyManagement exception
-