类 TlsHelper
- java.lang.Object
-
- com.alibaba.nacos.common.tls.TlsHelper
-
public final class TlsHelper extends java.lang.ObjectUtils for buildSSLContext.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()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static javax.net.ssl.SSLContextbuildSslContext(boolean forClient)Returns aSSLContexts.
-
-
-
方法详细资料
-
buildSslContext
public static javax.net.ssl.SSLContext buildSslContext(boolean forClient) throws java.security.NoSuchAlgorithmException, java.security.KeyManagementExceptionReturns aSSLContexts.For example
HttpsURLConnection.setDefaultSSLSocketFactory(TlsHelper.buildSslContext(true).getSocketFactory());- 参数:
forClient- whether for client- 返回:
SSLContext- 抛出:
java.security.NoSuchAlgorithmException- Not support the specified algorithmjava.security.KeyManagementException- KeyManagement exception
-
-