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 defaultTrustManager
of 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[]
accepted
TheX509Certificate
s 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.boolean
isTrusted(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:
isTrusted
in interfaceSSLTrustManager
- Parameters:
chain
- The peer certificate chain.- Returns:
true
.
-
getAcceptedIssuers
public java.security.cert.X509Certificate[] getAcceptedIssuers()
Returns the accepted certificates. They are set in thecheckServerTrusted
method.- Specified by:
getAcceptedIssuers
in interfaceSSLTrustManager
- Returns:
- A non-null (possibly empty) array of acceptable CA issuer certificates.
-
-