Package org.schwering.irc.lib
Class SSLDefaultTrustManager
- java.lang.Object
-
- org.schwering.irc.lib.SSLDefaultTrustManager
-
- All Implemented Interfaces:
com.sun.net.ssl.TrustManager
,com.sun.net.ssl.X509TrustManager
public class SSLDefaultTrustManager extends java.lang.Object implements com.sun.net.ssl.X509TrustManager
Deprecated.This class has been replaced withorg.schwering.irc.lib.ssl.SSLDefaultTrustManager
.The defaultTrustManager
of theSSLIRCConnection
.Note that this class is deprecated. The SSL supporting classes moved to
org.schwering.irc.lib.ssl
since IRClib 1.10.It automatically accepts the X509 certificate.
In many cases you should change the
SSLIRCConnection
'sTrustManager
. 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. You could do this by a new class which extends theSSLDefaultTrustManager
class and overrides thecheckServerTrusted
method and asks the user whether he wants to accept the certification or not.- See Also:
SSLIRCConnection
,TrustManager
-
-
Field Summary
Fields Modifier and Type Field Description protected java.security.cert.X509Certificate[]
accepted
Deprecated.TheX509Certificate
s which are accepted.
-
Constructor Summary
Constructors Constructor Description SSLDefaultTrustManager()
Deprecated.Creates a new instance of theSSLDefaultTrustManager
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.security.cert.X509Certificate[]
getAcceptedIssuers()
Deprecated.Returns the accepted certificates.boolean
isClientTrusted(java.security.cert.X509Certificate[] chain)
Deprecated.Does nothing.boolean
isServerTrusted(java.security.cert.X509Certificate[] chain)
Deprecated.Invoked when the client should check whether he trusts the server or not.
-
-
-
Method Detail
-
isClientTrusted
public final boolean isClientTrusted(java.security.cert.X509Certificate[] chain)
Deprecated.Does nothing. This method would check whether we (the server) trust the client. But we are the client and not the server.
It's final so that nobody can override it; it would make no sense.- Specified by:
isClientTrusted
in interfacecom.sun.net.ssl.X509TrustManager
- Parameters:
chain
- The peer certificate chain.- Returns:
- Always
false
.
-
isServerTrusted
public boolean isServerTrusted(java.security.cert.X509Certificate[] chain)
Deprecated.Invoked when the client should check whether he trusts the server or not. This method trusts the server. But this method can be overriden and then ask the user whether he truts the client or not.- Specified by:
isServerTrusted
in interfacecom.sun.net.ssl.X509TrustManager
- Parameters:
chain
- The peer certificate chain.- Returns:
- Always
true
.
-
getAcceptedIssuers
public java.security.cert.X509Certificate[] getAcceptedIssuers()
Deprecated.Returns the accepted certificates. They are set in thecheckServerTrusted
method.- Specified by:
getAcceptedIssuers
in interfacecom.sun.net.ssl.X509TrustManager
- Returns:
- A non-null (possibly empty) array of acceptable CA issuer certificates.
-
-