Class SSLTrustManagerWithHostnameChecking
java.lang.Object
javax.net.ssl.X509ExtendedTrustManager
eu.emi.security.authn.x509.helpers.ssl.SSLTrustManagerWithHostnameChecking
- All Implemented Interfaces:
TrustManager
,X509TrustManager
Wires CANL abstractions: credentials and verificators into Java SSL socket factory.
Supports hostname verification with a custom callback. If callback is unset then the mismatch of hostname to
peer's certificate is considered a fatal error.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSSLTrustManagerWithHostnameChecking
(X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkClientTrusted
(X509Certificate[] chain, String authType) void
checkClientTrusted
(X509Certificate[] chain, String authType, Socket socket) void
checkClientTrusted
(X509Certificate[] chain, String authType, SSLEngine engine) protected void
checkIfTrusted
(X509Certificate[] certChain) void
checkServerTrusted
(X509Certificate[] chain, String authType) void
checkServerTrusted
(X509Certificate[] chain, String authType, Socket socket) void
checkServerTrusted
(X509Certificate[] chain, String authType, SSLEngine engine)
-
Field Details
-
validator
-
-
Constructor Details
-
SSLTrustManagerWithHostnameChecking
public SSLTrustManagerWithHostnameChecking(X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback)
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException - Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException - Throws:
CertificateException
-
getAcceptedIssuers
-
checkIfTrusted
- Throws:
CertificateException
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) 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
-
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, SSLEngine engine) throws CertificateException - Specified by:
checkServerTrusted
in classX509ExtendedTrustManager
- Throws:
CertificateException
-