Class NoTrustSSLSocketFactory


  • public class NoTrustSSLSocketFactory
    extends SSLSocketFactory
    The NoTrustSSLSocketFactory class implements the no-trust SSL socket factory.
    Author:
    Marcus Portmann
    • Constructor Detail

      • NoTrustSSLSocketFactory

        public NoTrustSSLSocketFactory()
        Constructs a new NoTrustSSLSocketFactory
    • Method Detail

      • createSocket

        public Socket createSocket​(InetAddress host,
                                   int port)
                            throws IOException
        Creates a socket and connects it to the specified port number at the specified address.

        This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

        Specified by:
        createSocket in class SocketFactory
        Parameters:
        host - the address of the server host
        port - the server port
        Returns:
        a socket connected to the specified host and port
        Throws:
        IOException
      • createSocket

        public Socket createSocket​(String host,
                                   int port)
                            throws IOException
        Creates a socket and connects it to the specified remote host at the specified remote port.

        This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

        Specified by:
        createSocket in class SocketFactory
        Parameters:
        host - the server host
        port - the server port
        Returns:
        a socket connected to the specified host and port
        Throws:
        IOException
      • createSocket

        public Socket createSocket​(InetAddress host,
                                   int port,
                                   InetAddress localHost,
                                   int localPort)
                            throws IOException
        Creates a socket and connects it to the specified port number at the specified address. The socket will also be bound to the local address and port supplied.

        This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

        Specified by:
        createSocket in class SocketFactory
        Parameters:
        host - the address of the server host
        port - the server port
        localHost - the local address
        localPort - the local port
        Returns:
        a socket connected to the specified host and port
        Throws:
        IOException
      • createSocket

        public Socket createSocket​(Socket s,
                                   String host,
                                   int port,
                                   boolean autoClose)
                            throws IOException
        Returns a socket layered over an existing socket connected to the named host, at the given port.

        This constructor can be used when tunneling SSL through a proxy or when negotiating the use of SSL over an existing socket. The host and port refer to the logical peer destination. This socket is configured using the socket options established for this factory.

        Specified by:
        createSocket in class SSLSocketFactory
        Parameters:
        s - the existing socket
        host - the server host
        port - the server port
        autoClose - close the underlying socket when this socket is closed
        Returns:
        a socket connected to the specified host and port
        Throws:
        IOException
      • createSocket

        public Socket createSocket​(String host,
                                   int port,
                                   InetAddress localHost,
                                   int localPort)
                            throws IOException
        Creates a socket and connects it to the specified remote host at the specified remote port. The socket will also be bound to the local address and port supplied.

        This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

        Specified by:
        createSocket in class SocketFactory
        Parameters:
        host - the server host
        port - the server port
        localHost - the local address
        localPort - the local port
        Returns:
        a socket connected to the specified host and port
        Throws:
        IOException
      • getDefaultCipherSuites

        public String[] getDefaultCipherSuites()
        Returns the set of cipher suites which are enabled by default.

        Unless a different list is enabled, handshaking on an SSL connection will use one of these cipher suites. The minimum quality of service for these defaults requires confidentiality protection and server authentication (that is, no anonymous cipher suites).

        Specified by:
        getDefaultCipherSuites in class SSLSocketFactory
        Returns:
        the set of cipher suites which are enabled by default
      • getSupportedCipherSuites

        public String[] getSupportedCipherSuites()
        Returns the names of the cipher suites which could be enabled for use on an SSL connection.

        Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not meet quality of service requirements for those defaults. Such cipher suites are useful in specialized applications.

        Specified by:
        getSupportedCipherSuites in class SSLSocketFactory
        Returns:
        the names of the cipher suites which could be enabled for use on an SSL connection