|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
com.sun.mail.util.MailSSLSocketFactory
public class MailSSLSocketFactory
An SSL socket factory that makes it easier to specify trust. This socket factory can be configured to trust all hosts or trust a specific set of hosts, in which case the server's certificate isn't verified. Alternatively, a custom TrustManager can be supplied.
An instance of this factory can be set as the value of the
mail.<protocol>.ssl.socketFactory
property.
Constructor Summary | |
---|---|
MailSSLSocketFactory()
Initializes a new MailSSLSocketFactory. |
|
MailSSLSocketFactory(java.lang.String protocol)
Initializes a new MailSSLSocketFactory with a given protocol. |
Method Summary | |
---|---|
java.net.Socket |
createSocket()
|
java.net.Socket |
createSocket(java.net.InetAddress inetaddress,
int i)
|
java.net.Socket |
createSocket(java.net.InetAddress inetaddress,
int i,
java.net.InetAddress inetaddress1,
int j)
|
java.net.Socket |
createSocket(java.net.Socket socket,
java.lang.String s,
int i,
boolean flag)
|
java.net.Socket |
createSocket(java.lang.String s,
int i)
|
java.net.Socket |
createSocket(java.lang.String s,
int i,
java.net.InetAddress inetaddress,
int j)
|
java.lang.String[] |
getDefaultCipherSuites()
|
javax.net.ssl.KeyManager[] |
getKeyManagers()
|
java.security.SecureRandom |
getSecureRandom()
|
java.lang.String[] |
getSupportedCipherSuites()
|
java.lang.String[] |
getTrustedHosts()
|
javax.net.ssl.TrustManager[] |
getTrustManagers()
|
boolean |
isServerTrusted(java.lang.String server,
javax.net.ssl.SSLSocket sslSocket)
After a successful conection to the server, this method is called to ensure that the server should be trusted. |
boolean |
isTrustAllHosts()
|
void |
setKeyManagers(javax.net.ssl.KeyManager[] keyManagers)
|
void |
setSecureRandom(java.security.SecureRandom secureRandom)
|
void |
setTrustAllHosts(boolean trustAllHosts)
|
void |
setTrustedHosts(java.lang.String[] trustedHosts)
|
void |
setTrustManagers(javax.net.ssl.TrustManager[] trustManagers)
|
Methods inherited from class javax.net.ssl.SSLSocketFactory |
---|
getDefault |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailSSLSocketFactory() throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public MailSSLSocketFactory(java.lang.String protocol) throws java.security.GeneralSecurityException
protocol
- The protocol to use
java.security.NoSuchAlgorithmException
- if given protocol is not supported
java.security.GeneralSecurityException
Method Detail |
---|
public javax.net.ssl.KeyManager[] getKeyManagers()
public void setKeyManagers(javax.net.ssl.KeyManager[] keyManagers) throws java.security.GeneralSecurityException
keyManagers
- the keyManagers to set
java.security.GeneralSecurityException
public java.security.SecureRandom getSecureRandom()
public void setSecureRandom(java.security.SecureRandom secureRandom) throws java.security.GeneralSecurityException
secureRandom
- the secureRandom to set
java.security.GeneralSecurityException
public javax.net.ssl.TrustManager[] getTrustManagers()
public void setTrustManagers(javax.net.ssl.TrustManager[] trustManagers) throws java.security.GeneralSecurityException
trustManagers
- the trustManagers to set
java.security.GeneralSecurityException
public boolean isTrustAllHosts()
public void setTrustAllHosts(boolean trustAllHosts)
trustAllHosts
- should all hosts be trusted?public java.lang.String[] getTrustedHosts()
public void setTrustedHosts(java.lang.String[] trustedHosts)
trustedHosts
- the hosts to trustpublic boolean isServerTrusted(java.lang.String server, javax.net.ssl.SSLSocket sslSocket)
server
- name of the server we connected tosslSocket
- SSLSocket connected to the server
public java.net.Socket createSocket(java.net.Socket socket, java.lang.String s, int i, boolean flag) throws java.io.IOException
createSocket
in class javax.net.ssl.SSLSocketFactory
java.io.IOException
public java.lang.String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class javax.net.ssl.SSLSocketFactory
public java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class javax.net.ssl.SSLSocketFactory
public java.net.Socket createSocket() throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException
public java.net.Socket createSocket(java.net.InetAddress inetaddress, int i, java.net.InetAddress inetaddress1, int j) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException
public java.net.Socket createSocket(java.net.InetAddress inetaddress, int i) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
java.io.IOException
public java.net.Socket createSocket(java.lang.String s, int i, java.net.InetAddress inetaddress, int j) throws java.io.IOException, java.net.UnknownHostException
createSocket
in class javax.net.SocketFactory
java.io.IOException
java.net.UnknownHostException
public java.net.Socket createSocket(java.lang.String s, int i) throws java.io.IOException, java.net.UnknownHostException
createSocket
in class javax.net.SocketFactory
java.io.IOException
java.net.UnknownHostException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |