Package org.schwering.irc.lib.ssl
Class SSLDefaultTrustManager
- java.lang.Object
-
- org.schwering.irc.lib.ssl.SSLDefaultTrustManager
-
- All Implemented Interfaces:
SSLTrustManager
public class SSLDefaultTrustManager extends java.lang.Object implements SSLTrustManager
The defaultTrustManagerof theSSLIRCConnection.It automatically accepts the X509 certificate.
In many cases you should change the
SSLIRCConnection'sSSLTrustManager. For examle if you write an IRC client for human users, you may want to ask the user whether he accepts the server's certificate or not.- Since:
- 1.10
- See Also:
SSLIRCConnection,SSLTrustManager
-
-
Field Summary
Fields Modifier and Type Field Description protected java.security.cert.X509Certificate[]acceptedTheX509Certificates which are accepted.
-
Constructor Summary
Constructors Constructor Description SSLDefaultTrustManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.cert.X509Certificate[]getAcceptedIssuers()Returns the accepted certificates.booleanisTrusted(java.security.cert.X509Certificate[] chain)Trusts the complete certificate chain and returnstrue.
-
-
-
Method Detail
-
isTrusted
public boolean isTrusted(java.security.cert.X509Certificate[] chain)
Trusts the complete certificate chain and returnstrue.- Specified by:
isTrustedin interfaceSSLTrustManager- Parameters:
chain- The peer certificate chain.- Returns:
true.
-
getAcceptedIssuers
public java.security.cert.X509Certificate[] getAcceptedIssuers()
Returns the accepted certificates. They are set in thecheckServerTrustedmethod.- Specified by:
getAcceptedIssuersin interfaceSSLTrustManager- Returns:
- A non-null (possibly empty) array of acceptable CA issuer certificates.
-
-