public class MailSSLSocketFactory extends SSLSocketFactory
An instance of this factory can be set as the value of the
mail.<protocol>.ssl.socketFactory
property.
Constructor and Description |
---|
MailSSLSocketFactory()
Initializes a new MailSSLSocketFactory.
|
MailSSLSocketFactory(String protocol)
Initializes a new MailSSLSocketFactory with a given protocol.
|
Modifier and Type | Method and Description |
---|---|
Socket |
createSocket() |
Socket |
createSocket(InetAddress inetaddress,
int i) |
Socket |
createSocket(InetAddress inetaddress,
int i,
InetAddress inetaddress1,
int j) |
Socket |
createSocket(Socket socket,
String s,
int i,
boolean flag) |
Socket |
createSocket(String s,
int i) |
Socket |
createSocket(String s,
int i,
InetAddress inetaddress,
int j) |
String[] |
getDefaultCipherSuites() |
KeyManager[] |
getKeyManagers() |
SecureRandom |
getSecureRandom() |
String[] |
getSupportedCipherSuites() |
String[] |
getTrustedHosts() |
TrustManager[] |
getTrustManagers() |
boolean |
isServerTrusted(String server,
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(KeyManager[] keyManagers) |
void |
setSecureRandom(SecureRandom secureRandom) |
void |
setTrustAllHosts(boolean trustAllHosts) |
void |
setTrustedHosts(String[] trustedHosts) |
void |
setTrustManagers(TrustManager[] trustManagers) |
getDefault
public MailSSLSocketFactory() throws GeneralSecurityException
GeneralSecurityException
public MailSSLSocketFactory(String protocol) throws GeneralSecurityException
protocol
- The protocol to useNoSuchAlgorithmException
- if given protocol is not supportedGeneralSecurityException
public KeyManager[] getKeyManagers()
public void setKeyManagers(KeyManager[] keyManagers) throws GeneralSecurityException
keyManagers
- the keyManagers to setGeneralSecurityException
public SecureRandom getSecureRandom()
public void setSecureRandom(SecureRandom secureRandom) throws GeneralSecurityException
secureRandom
- the secureRandom to setGeneralSecurityException
public TrustManager[] getTrustManagers()
public void setTrustManagers(TrustManager[] trustManagers) throws GeneralSecurityException
trustManagers
- the trustManagers to setGeneralSecurityException
public boolean isTrustAllHosts()
public void setTrustAllHosts(boolean trustAllHosts)
trustAllHosts
- should all hosts be trusted?public String[] getTrustedHosts()
public void setTrustedHosts(String[] trustedHosts)
trustedHosts
- the hosts to trustpublic boolean isServerTrusted(String server, SSLSocket sslSocket)
server
- name of the server we connected tosslSocket
- SSLSocket connected to the serverpublic Socket createSocket(Socket socket, String s, int i, boolean flag) throws IOException
createSocket
in class SSLSocketFactory
IOException
public String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class SSLSocketFactory
public String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class SSLSocketFactory
public Socket createSocket() throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(InetAddress inetaddress, int i, InetAddress inetaddress1, int j) throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(InetAddress inetaddress, int i) throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(String s, int i, InetAddress inetaddress, int j) throws IOException, UnknownHostException
createSocket
in class SocketFactory
IOException
UnknownHostException
public Socket createSocket(String s, int i) throws IOException, UnknownHostException
createSocket
in class SocketFactory
IOException
UnknownHostException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.