public class MailSSLSocketFactory
extends javax.net.ssl.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(java.lang.String protocol)
Initializes a new MailSSLSocketFactory with a given protocol.
|
Modifier and Type | Method and Description |
---|---|
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) |
public MailSSLSocketFactory() throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public MailSSLSocketFactory(java.lang.String protocol) throws java.security.GeneralSecurityException
protocol
- The protocol to usejava.security.NoSuchAlgorithmException
- if given protocol is not supportedjava.security.GeneralSecurityException
public javax.net.ssl.KeyManager[] getKeyManagers()
public void setKeyManagers(javax.net.ssl.KeyManager[] keyManagers) throws java.security.GeneralSecurityException
keyManagers
- the keyManagers to setjava.security.GeneralSecurityException
public java.security.SecureRandom getSecureRandom()
public void setSecureRandom(java.security.SecureRandom secureRandom) throws java.security.GeneralSecurityException
secureRandom
- the secureRandom to setjava.security.GeneralSecurityException
public javax.net.ssl.TrustManager[] getTrustManagers()
public void setTrustManagers(javax.net.ssl.TrustManager[] trustManagers) throws java.security.GeneralSecurityException
trustManagers
- the trustManagers to setjava.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 serverpublic 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
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"