Package org.apache.pulsar.common.util
Class TrustManagerProxy
java.lang.Object
javax.net.ssl.X509ExtendedTrustManager
org.apache.pulsar.common.util.TrustManagerProxy
- All Implemented Interfaces:
TrustManager
,X509TrustManager
This class wraps
X509ExtendedTrustManager
and gives opportunity to refresh Trust-manager with refreshed certs
without changing SslContext
.-
Constructor Summary
ConstructorDescriptionTrustManagerProxy
(String caCertFile, int refreshDurationSec, ScheduledExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkClientTrusted
(X509Certificate[] x509Certificates, String s) void
checkClientTrusted
(X509Certificate[] chain, String authType, Socket socket) void
checkClientTrusted
(X509Certificate[] chain, String authType, SSLEngine engine) void
checkServerTrusted
(X509Certificate[] x509Certificates, String s) void
checkServerTrusted
(X509Certificate[] chain, String authType, Socket socket) void
checkServerTrusted
(X509Certificate[] chain, String authType, SSLEngine engine)
-
Constructor Details
-
TrustManagerProxy
public TrustManagerProxy(String caCertFile, int refreshDurationSec, ScheduledExecutorService executor)
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException - Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException - Throws:
CertificateException
-
getAcceptedIssuers
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException - Specified by:
checkClientTrusted
in classX509ExtendedTrustManager
- Throws:
CertificateException
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException - Specified by:
checkClientTrusted
in classX509ExtendedTrustManager
- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException - Specified by:
checkServerTrusted
in classX509ExtendedTrustManager
- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException - Specified by:
checkServerTrusted
in classX509ExtendedTrustManager
- Throws:
CertificateException
-