Package org.jivesoftware.openfire.net
Class ClientTrustManager
- java.lang.Object
-
- org.jivesoftware.openfire.net.ClientTrustManager
-
- All Implemented Interfaces:
TrustManager
,X509TrustManager
public class ClientTrustManager extends Object implements X509TrustManager
ClientTrustManager is a Trust Manager that is only used for c2s connections. This TrustManager is used both when a client connects to this server. It is possible to indicate if self-signed certificates are going to be accepted. In case of accepting a self-signed certificate a warning is logged. Future version of the server might include a small workflow so admins can review self-signed certificates or certificates of unknown issuers and manually accept them.- Author:
- Gaston Dombiak, Jay Kline
-
-
Constructor Summary
Constructors Constructor Description ClientTrustManager(KeyStore trustTrust)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkClientTrusted(X509Certificate[] x509Certificates, String string)
void
checkServerTrusted(X509Certificate[] x509Certificates, String string)
Given the partial or complete certificate chain provided by the peer, build a certificate path to a trusted root and return if it can be validated and is trusted for server SSL authentication based on the authentication type.X509Certificate[]
getAcceptedIssuers()
-
-
-
Constructor Detail
-
ClientTrustManager
public ClientTrustManager(KeyStore trustTrust)
-
-
Method Detail
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] x509Certificates, String string) throws CertificateException
- Specified by:
checkClientTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] x509Certificates, String string) throws CertificateException
Given the partial or complete certificate chain provided by the peer, build a certificate path to a trusted root and return if it can be validated and is trusted for server SSL authentication based on the authentication type. The authentication type is the key exchange algorithm portion of the cipher suites represented as a String, such as "RSA", "DHE_DSS". Note: for some exportable cipher suites, the key exchange algorithm is determined at run time during the handshake. For instance, for TLS_RSA_EXPORT_WITH_RC4_40_MD5, the authType should be RSA_EXPORT when an ephemeral RSA key is used for the key exchange, and RSA when the key from the server certificate is used. Checking is case-sensitive.By default certificates are going to be verified. This includes verifying the certificate chain, the root certificate and the certificates validity. However, it is possible to disable certificates validation as a whole or each specific validation.
- Specified by:
checkServerTrusted
in interfaceX509TrustManager
- Parameters:
x509Certificates
- an ordered array of peer X.509 certificates with the peer's own certificate listed first and followed by any certificate authorities.string
- the key exchange algorithm used.- Throws:
CertificateException
- if the certificate chain is not trusted by this TrustManager.
-
getAcceptedIssuers
public X509Certificate[] getAcceptedIssuers()
- Specified by:
getAcceptedIssuers
in interfaceX509TrustManager
-
-