Class SslConnection<T extends Connector>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    SelectionListener

    @Deprecated
    public class SslConnection<T extends Connector>
    extends Connection<T>
    Deprecated.
    Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.
    Connection secured with SSL/TLS protocols.
    • Field Detail

      • isHandshaking

        private volatile boolean isHandshaking
        Deprecated.
        Whether a handshake is in progress.
      • peerAddress

        private volatile java.net.InetSocketAddress peerAddress
        Deprecated.
        The peer address.
      • sslEngine

        private volatile javax.net.ssl.SSLEngine sslEngine
        Deprecated.
        The engine to use for wrapping and unwrapping.
      • sslEngineResult

        private volatile javax.net.ssl.SSLEngineResult sslEngineResult
        Deprecated.
        The engine result.
    • Constructor Detail

      • SslConnection

        public SslConnection​(ConnectionHelper<T> helper,
                             java.nio.channels.SocketChannel socketChannel,
                             ConnectionController controller,
                             java.net.InetSocketAddress socketAddress,
                             javax.net.ssl.SSLEngine sslEngine)
                      throws java.io.IOException
        Deprecated.
        Constructor.
        Parameters:
        helper - The parent connector helper.
        socketChannel - The underlying NIO socket channel.
        controller - The IO controller.
        socketAddress - The associated IP address.
        Throws:
        java.io.IOException
    • Method Detail

      • getApplicationBufferSize

        public int getApplicationBufferSize()
        Deprecated.
        Returns the suggested application buffer size.
        Returns:
        The suggested application buffer size.
      • getPacketBufferSize

        public int getPacketBufferSize()
        Deprecated.
        Returns the suggested SSL packet buffer size.
        Returns:
        The suggested SSL packet buffer size.
      • getPeerAddress

        public java.net.InetSocketAddress getPeerAddress()
        Deprecated.
        Returns the peer address.
        Returns:
        The peer address.
      • getSslCipherSuite

        public java.lang.String getSslCipherSuite()
        Deprecated.
        Returns the SSL cipher suite.
        Returns:
        The SSL cipher suite.
      • getSslClientCertificates

        public java.util.List<java.security.cert.Certificate> getSslClientCertificates()
        Deprecated.
        Returns the list of client SSL certificates.
        Returns:
        The list of client SSL certificates.
      • getSslEngine

        public javax.net.ssl.SSLEngine getSslEngine()
        Deprecated.
        Returns the engine to use for wrapping and unwrapping.
        Returns:
        The engine to use for wrapping and unwrapping.
      • getSslEngineResult

        public javax.net.ssl.SSLEngineResult getSslEngineResult()
        Deprecated.
        Returns the engine result.
        Returns:
        The engine result.
      • getSslEngineStatus

        public javax.net.ssl.SSLEngineResult.Status getSslEngineStatus()
        Deprecated.
        Returns the latest SSL engine status, or SSLEngineResult.Status.OK otherwise.
        Returns:
        The latest SSL engine status.
      • getSslHandshakeStatus

        public javax.net.ssl.SSLEngineResult.HandshakeStatus getSslHandshakeStatus()
        Deprecated.
        Returns the SSL handshake status, either from the latest engine result or from the SSL engine.
        Returns:
        The SSL handshake status.
      • getSslKeySize

        public java.lang.Integer getSslKeySize()
        Deprecated.
        Returns the SSL key size, if available and accessible.
        Returns:
        The SSL key size, if available and accessible.
      • getSslSession

        public javax.net.ssl.SSLSession getSslSession()
        Deprecated.
        Returns the current SSL session or null.
        Returns:
        The current SSL session or null.
      • handleSslHandshake

        private void handleSslHandshake()
                                 throws java.io.IOException
        Deprecated.
        Handles the SSL handshake states based on the last result received.
        Throws:
        java.io.IOException
      • handleSslResult

        public void handleSslResult()
                             throws java.io.IOException
        Deprecated.
        Handles the result of a previous SSL engine processing.
        Throws:
        java.io.IOException
      • initSslEngine

        public void initSslEngine()
                           throws javax.net.ssl.SSLException
        Deprecated.
        Initializes the SSL engine with the current SSL context and socket address.
        Throws:
        javax.net.ssl.SSLException
      • isSslHandshaking

        public boolean isSslHandshaking()
        Deprecated.
        Indicates if the SSL handshake is going on.
        Returns:
        True if the SSL handshake is going on.
      • onFinished

        private void onFinished()
        Deprecated.
        Notifies that the SSL handshake is finished. Application data can now be exchanged.
      • onNeedTask

        private void onNeedTask()
        Deprecated.
        Runs the pending lengthy task.
      • onUnwrap

        private void onUnwrap()
                       throws java.io.IOException
        Deprecated.
        Callback invoked when the SSL handshake requires unwrapping.
        Throws:
        java.io.IOException
      • onWrap

        private void onWrap()
                     throws java.io.IOException
        Deprecated.
        Callback invoked when the SSL handshake requires wrapping.
        Throws:
        java.io.IOException
      • reuse

        public void reuse​(java.nio.channels.SocketChannel socketChannel,
                          ConnectionController controller,
                          java.net.InetSocketAddress socketAddress)
                   throws java.io.IOException
        Deprecated.
        Description copied from class: Connection
        Reuses the connection and associates it to the given socket.
        Overrides:
        reuse in class Connection<T extends Connector>
        Parameters:
        socketChannel - The underlying NIO socket channel.
        controller - The underlying IO controller.
        socketAddress - The associated socket address.
        Throws:
        java.io.IOException
      • setPeerAddress

        public void setPeerAddress​(java.net.InetSocketAddress peerAddress)
        Deprecated.
        Sets the peer address.
        Parameters:
        peerAddress - The peer address.
      • setSslEngine

        public void setSslEngine​(javax.net.ssl.SSLEngine engine)
        Deprecated.
        Sets the engine to use for wrapping and unwrapping.
        Parameters:
        engine - The engine to use for wrapping and unwrapping.
      • setSslEngineResult

        protected void setSslEngineResult​(javax.net.ssl.SSLEngineResult engineResult)
        Deprecated.
        Sets the engine result.
        Parameters:
        engineResult - The engine result.
      • setSslResult

        public void setSslResult​(javax.net.ssl.SSLEngineResult sslResult)
                          throws java.io.IOException
        Deprecated.
        Saves the result of a previous SSL engine processing.
        Parameters:
        sslResult - The SSL result to handle.
        Throws:
        java.io.IOException
      • shutdown

        protected void shutdown​(java.net.Socket socket)
                         throws java.io.IOException
        Deprecated.
        Description copied from class: Connection
        Shutdowns the socket, first its input then its output.
        Overrides:
        shutdown in class Connection<T extends Connector>
        Parameters:
        socket - The socket to shutdown.
        Throws:
        java.io.IOException