public class UtilSSLSocketFactory extends SSLSocketFactory
Most methods follow the builder pattern, meaning you can declare and setup this Socket Factory in one line
Disabling Diffie Hellman code by Sam on StackOverflow
Implemented and Maintained in PircBotX by: Leon Blakey
Modifier and Type | Class and Description |
---|---|
static class |
UtilSSLSocketFactory.TrustingX509TrustManager
X509TrustManager that trusts all certificates.
|
Constructor and Description |
---|
UtilSSLSocketFactory() |
getDefault
public UtilSSLSocketFactory trustAllCertificates()
disableDiffieHellman(javax.net.ssl.SSLSocketFactory)
since this overwrites the wrapped factory and will throw an exception!public UtilSSLSocketFactory disableDiffieHellman()
Note that this requires that the server supports other key exchange algorithms. This socket factory (nor any other built in Socket Factory) cannot connect to a server that only supports Diffie Hellman key exchange with prime sizes larger than 1024 bits.
Also see PircBotX Issue #34
public UtilSSLSocketFactory disableDiffieHellman(SSLSocketFactory sourceSocketFactory)
disableDiffieHellman(javax.net.ssl.SSLSocketFactory)
since this overwrites the wrapped factory and will throw an exception!sourceSocketFactory
- disableDiffieHellman()
public SSLSocket createSocket(String host, int port) throws IOException, UnknownHostException
createSocket
in class SocketFactory
IOException
UnknownHostException
public SSLSocket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException
createSocket
in class SocketFactory
IOException
UnknownHostException
public SSLSocket createSocket(InetAddress address, int port) throws IOException
createSocket
in class SocketFactory
IOException
public SSLSocket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
createSocket
in class SocketFactory
IOException
public SSLSocket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException
createSocket
in class SSLSocketFactory
IOException
public SSLSocket createSocket(Socket socket, InputStream in, boolean bln) throws IOException
createSocket
in class SSLSocketFactory
IOException
public SSLSocket createSocket() throws IOException
createSocket
in class SocketFactory
IOException
public String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class SSLSocketFactory
public String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class SSLSocketFactory
@Generated(value="lombok") public boolean isTrustingAllCertificates()
@Generated(value="lombok") public boolean isDiffieHellmanDisabled()
Copyright © 2010–2020 Leon Blakey. All rights reserved.