Package org.conscrypt

Class OpenSSLServerSocketImpl

All Implemented Interfaces:
Closeable, AutoCloseable

public class OpenSSLServerSocketImpl
extends SSLServerSocket
OpenSSL-based implementation of server sockets.
  • Constructor Details

  • Method Details

    • getEnableSessionCreation

      public boolean getEnableSessionCreation()
      Description copied from class: SSLServerSocket
      Returns whether new SSL sessions may be established for new connections.
      Specified by:
      getEnableSessionCreation in class SSLServerSocket
      Returns:
      true if new SSL sessions may be established, false if existing SSL sessions must be reused.
    • setEnableSessionCreation

      public void setEnableSessionCreation​(boolean flag)
      Description copied from class: SSLServerSocket
      Sets whether new SSL sessions may be established for new connections.
      Specified by:
      setEnableSessionCreation in class SSLServerSocket
      Parameters:
      flag - true if new SSL sessions may be established, false if existing SSL sessions must be reused.
    • getSupportedProtocols

      public String[] getSupportedProtocols()
      The names of the protocols' versions that may be used on this SSL connection.
      Specified by:
      getSupportedProtocols in class SSLServerSocket
      Returns:
      an array of protocols names
    • getEnabledProtocols

      public String[] getEnabledProtocols()
      The names of the protocols' versions that in use on this SSL connection.
      Specified by:
      getEnabledProtocols in class SSLServerSocket
      Returns:
      an array of protocols names
    • setEnabledProtocols

      public void setEnabledProtocols​(String[] protocols)
      This method enables the protocols' versions listed by getSupportedProtocols().
      Specified by:
      setEnabledProtocols in class SSLServerSocket
      Parameters:
      protocols - names of all the protocols to enable.
      Throws:
      IllegalArgumentException - when one or more of the names in the array are not supported, or when the array is null.
    • getSupportedCipherSuites

      public String[] getSupportedCipherSuites()
      Description copied from class: SSLServerSocket
      Returns the names of the supported cipher suites.
      Specified by:
      getSupportedCipherSuites in class SSLServerSocket
      Returns:
      the names of the supported cipher suites.
    • getEnabledCipherSuites

      public String[] getEnabledCipherSuites()
      Description copied from class: SSLServerSocket
      Returns the names of the enabled cipher suites to be used for new connections.
      Specified by:
      getEnabledCipherSuites in class SSLServerSocket
      Returns:
      the names of the enabled cipher suites to be used for new connections.
    • setChannelIdEnabled

      public void setChannelIdEnabled​(boolean enabled)
      Enables/disables the TLS Channel ID extension for this server socket.
    • isChannelIdEnabled

      public boolean isChannelIdEnabled()
      Checks whether the TLS Channel ID extension is enabled for this server socket.
    • setEnabledCipherSuites

      public void setEnabledCipherSuites​(String[] suites)
      This method enables the cipher suites listed by getSupportedCipherSuites().
      Specified by:
      setEnabledCipherSuites in class SSLServerSocket
      Parameters:
      suites - the names of all the cipher suites to enable
      Throws:
      IllegalArgumentException - when one or more of the ciphers in array suites are not supported, or when the array is null.
    • getWantClientAuth

      public boolean getWantClientAuth()
      Description copied from class: SSLServerSocket
      Returns whether server-mode connections will be configured to request client authentication.
      Specified by:
      getWantClientAuth in class SSLServerSocket
      Returns:
      true is client authentication will be requested, false if no client authentication is needed.
    • setWantClientAuth

      public void setWantClientAuth​(boolean want)
      Description copied from class: SSLServerSocket
      Sets whether server-mode connections will be configured to request client authentication. The client authentication is one of the following:
      • authentication required
      • authentication requested
      • no authentication needed
      This method overrides the setting of SSLServerSocket.setNeedClientAuth(boolean).
      Specified by:
      setWantClientAuth in class SSLServerSocket
      Parameters:
      want - true if client authentication should be requested, false if no authentication is needed.
    • getNeedClientAuth

      public boolean getNeedClientAuth()
      Description copied from class: SSLServerSocket
      Returns whether server-mode connections will be configured to require client authentication.
      Specified by:
      getNeedClientAuth in class SSLServerSocket
      Returns:
      true if client authentication is required, false if no client authentication is needed.
    • setNeedClientAuth

      public void setNeedClientAuth​(boolean need)
      Description copied from class: SSLServerSocket
      Sets whether server-mode connections will be configured to require client authentication. The client authentication is one of the following:
      • authentication required
      • authentication requested
      • no authentication needed
      This method overrides the setting of SSLServerSocket.setWantClientAuth(boolean).
      Specified by:
      setNeedClientAuth in class SSLServerSocket
      Parameters:
      need - true if client authentication is required, false if no authentication is needed.
    • setUseClientMode

      public void setUseClientMode​(boolean mode)
      Description copied from class: SSLServerSocket
      Sets whether new connections should act in client mode when handshaking.
      Specified by:
      setUseClientMode in class SSLServerSocket
      Parameters:
      mode - true if new connections should act in client mode, false if not.
    • getUseClientMode

      public boolean getUseClientMode()
      Description copied from class: SSLServerSocket
      Returns whether new connection will act in client mode when handshaking.
      Specified by:
      getUseClientMode in class SSLServerSocket
      Returns:
      true if new connections will act in client mode when handshaking, false if not.
    • accept

      public Socket accept() throws IOException
      Description copied from class: ServerSocket
      Waits for an incoming request and blocks until the connection is opened. This method returns a socket object representing the just opened connection.
      Overrides:
      accept in class ServerSocket
      Returns:
      the connection representing socket.
      Throws:
      IOException - if an error occurs while accepting a new connection.