Package org.conscrypt

Class OpenSSLSocketImpl

    • Constructor Detail

      • OpenSSLSocketImpl

        OpenSSLSocketImpl()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • OpenSSLSocketImpl

        OpenSSLSocketImpl​(java.lang.String hostname,
                          int port)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • OpenSSLSocketImpl

        OpenSSLSocketImpl​(java.net.InetAddress address,
                          int port)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • OpenSSLSocketImpl

        OpenSSLSocketImpl​(java.lang.String hostname,
                          int port,
                          java.net.InetAddress clientAddress,
                          int clientPort)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • OpenSSLSocketImpl

        OpenSSLSocketImpl​(java.net.InetAddress address,
                          int port,
                          java.net.InetAddress clientAddress,
                          int clientPort)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • OpenSSLSocketImpl

        OpenSSLSocketImpl​(java.net.Socket socket,
                          java.lang.String hostname,
                          int port,
                          boolean autoClose)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getHostname

        public java.lang.String getHostname()
        Description copied from class: AbstractConscryptSocket
        Returns the hostname that was supplied during socket creation. No DNS resolution is attempted before returning the hostname.
        Overrides:
        getHostname in class AbstractConscryptSocket
      • setHostname

        public void setHostname​(java.lang.String hostname)
        Description copied from class: AbstractConscryptSocket
        This method enables Server Name Indication
        Overrides:
        setHostname in class AbstractConscryptSocket
        Parameters:
        hostname - the desired SNI hostname, or null to disable
      • getHostnameOrIP

        public java.lang.String getHostnameOrIP()
        Description copied from class: AbstractConscryptSocket
        For the purposes of an SSLSession, we want a way to represent the supplied hostname or the IP address in a textual representation. We do not want to perform reverse DNS lookups on this address.
        Overrides:
        getHostnameOrIP in class AbstractConscryptSocket
      • setSoWriteTimeout

        public void setSoWriteTimeout​(int writeTimeoutMilliseconds)
                               throws java.net.SocketException
        Description copied from class: AbstractConscryptSocket
        Note write timeouts are not part of the javax.net.ssl.SSLSocket API
        Overrides:
        setSoWriteTimeout in class AbstractConscryptSocket
        Throws:
        java.net.SocketException
      • setHandshakeTimeout

        public void setHandshakeTimeout​(int handshakeTimeoutMilliseconds)
                                 throws java.net.SocketException
        Description copied from class: AbstractConscryptSocket
        Set the handshake timeout on this socket. This timeout is specified in milliseconds and will be used only during the handshake process.
        Overrides:
        setHandshakeTimeout in class AbstractConscryptSocket
        Throws:
        java.net.SocketException
      • setUseSessionTickets

        public abstract void setUseSessionTickets​(boolean useSessionTickets)
        Description copied from class: AbstractConscryptSocket
        This method enables session ticket support.
        Specified by:
        setUseSessionTickets in class AbstractConscryptSocket
        Parameters:
        useSessionTickets - True to enable session tickets
      • setChannelIdEnabled

        public abstract void setChannelIdEnabled​(boolean enabled)
        Description copied from class: AbstractConscryptSocket
        Enables/disables TLS Channel ID for this server socket.

        This method needs to be invoked before the handshake starts.

        Specified by:
        setChannelIdEnabled in class AbstractConscryptSocket
      • getChannelId

        public abstract byte[] getChannelId()
                                     throws javax.net.ssl.SSLException
        Description copied from class: AbstractConscryptSocket
        Gets the TLS Channel ID for this server socket. Channel ID is only available once the handshake completes.
        Specified by:
        getChannelId in class AbstractConscryptSocket
        Returns:
        channel ID or null if not available.
        Throws:
        javax.net.ssl.SSLException - if channel ID is available but could not be obtained.
      • setChannelIdPrivateKey

        public abstract void setChannelIdPrivateKey​(java.security.PrivateKey privateKey)
        Description copied from class: AbstractConscryptSocket
        Sets the PrivateKey to be used for TLS Channel ID by this client socket.

        This method needs to be invoked before the handshake starts.

        Specified by:
        setChannelIdPrivateKey in class AbstractConscryptSocket
        Parameters:
        privateKey - private key (enables TLS Channel ID) or null for no key (disables TLS Channel ID). The private key must be an Elliptic Curve (EC) key based on the NIST P-256 curve (aka SECG secp256r1 or ANSI X9.62 prime256v1).
      • getNpnSelectedProtocol

        @Deprecated
        public final byte[] getNpnSelectedProtocol()
        Deprecated.
        NPN is not supported
      • setNpnProtocols

        @Deprecated
        public final void setNpnProtocols​(byte[] npnProtocols)
        Deprecated.
        NPN is not supported