Class TrustAllSslSocketFactory


  • public class TrustAllSslSocketFactory
    extends SocketFactoryImpl
    Socket factory that trusts all SSL connections.
    • Field Detail

      • sslSocketFactory

        private final javax.net.ssl.SSLSocketFactory sslSocketFactory
    • Constructor Detail

      • TrustAllSslSocketFactory

        protected TrustAllSslSocketFactory()
    • Method Detail

      • createSocket

        public java.net.Socket createSocket()
                                     throws java.io.IOException
        Overrides:
        createSocket in class SocketFactoryImpl
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.net.InetAddress host,
                                            int port)
                                     throws java.io.IOException
        Overrides:
        createSocket in class SocketFactoryImpl
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.net.InetAddress address,
                                            int port,
                                            java.net.InetAddress localAddress,
                                            int localPort)
                                     throws java.io.IOException
        Overrides:
        createSocket in class SocketFactoryImpl
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port)
                                     throws java.io.IOException
        Overrides:
        createSocket in class SocketFactoryImpl
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port,
                                            java.net.InetAddress localHost,
                                            int localPort)
                                     throws java.io.IOException
        Overrides:
        createSocket in class SocketFactoryImpl
        Throws:
        java.io.IOException
      • getDefaultSSLSocketFactory

        public static javax.net.ssl.SSLSocketFactory getDefaultSSLSocketFactory()
      • createSSLSocketFactory

        public static javax.net.ssl.SSLSocketFactory createSSLSocketFactory()
        Creates an "accept-all" SSLSocketFactory - ssl sockets will accept ANY certificate sent to them - thus effectively just securing the communications. This could be set in a HttpsURLConnection using HttpsURLConnection.setSSLSocketFactory(.....)
        Returns:
        SSLSocketFactory