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.
|
createSocket, getDefault
public MailSSLSocketFactory() throws GeneralSecurityException
GeneralSecurityException
- for security errorspublic MailSSLSocketFactory(String protocol) throws GeneralSecurityException
protocol
- The protocol to useNoSuchAlgorithmException
- if given protocol is not supportedGeneralSecurityException
- for security errorspublic KeyManager[] getKeyManagers()
public void setKeyManagers(KeyManager[] keyManagers) throws GeneralSecurityException
keyManagers
- the keyManagers to setGeneralSecurityException
- for security errorspublic SecureRandom getSecureRandom()
public void setSecureRandom(SecureRandom secureRandom) throws GeneralSecurityException
secureRandom
- the secureRandom to setGeneralSecurityException
- for security errorspublic TrustManager[] getTrustManagers()
public void setTrustManagers(TrustManager[] trustManagers) throws GeneralSecurityException
trustManagers
- the trustManagers to setGeneralSecurityException
- for security errorspublic 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 © 1996-2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.