Package org.apache.tomcat.util.net.openssl

## Class OpenSSLEngine

- java.lang.Object
- - javax.net.ssl.SSLEngine
  - - org.apache.tomcat.util.net.openssl.OpenSSLEngine

All Implemented Interfaces:
  `SSLUtil.ProtocolInfo`

    public final class OpenSSLEngine
    extends javax.net.ssl.SSLEngine
    implements SSLUtil.ProtocolInfo

Implements a `SSLEngine` using OpenSSL BIO abstractions.

### Field Summary

Fields
`static java.util.Set<java.lang.String>` `AVAILABLE_CIPHER_SUITES`
`static java.util.Set<java.lang.String>` `IMPLEMENTED_PROTOCOLS_SET`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `beginHandshake()`
`void` `closeInbound()`
`void` `closeOutbound()`
`protected void` `finalize()`
`java.lang.Runnable` `getDelegatedTask()`
`java.lang.String[]` `getEnabledCipherSuites()`
`java.lang.String[]` `getEnabledProtocols()`
`boolean` `getEnableSessionCreation()`
`javax.net.ssl.SSLEngineResult.HandshakeStatus` `getHandshakeStatus()`
`boolean` `getNeedClientAuth()`
`java.lang.String` `getNegotiatedProtocol()` ALPN information.
`javax.net.ssl.SSLSession` `getSession()`
`java.lang.String[]` `getSupportedCipherSuites()`
`java.lang.String[]` `getSupportedProtocols()`
`boolean` `getUseClientMode()`
`boolean` `getWantClientAuth()`
`boolean` `isInboundDone()`
`boolean` `isOutboundDone()`
`void` `setEnabledCipherSuites​(java.lang.String[] cipherSuites)`
`void` `setEnabledProtocols​(java.lang.String[] protocols)`
`void` `setEnableSessionCreation​(boolean b)`
`void` `setNeedClientAuth​(boolean b)`
`void` `setUseClientMode​(boolean clientMode)`
`void` `setWantClientAuth​(boolean b)`
`void` `shutdown()` Destroys this engine.
`javax.net.ssl.SSLEngineResult` `unwrap​(java.nio.ByteBuffer src, java.nio.ByteBuffer[] dsts, int offset, int length)`
`javax.net.ssl.SSLEngineResult` `wrap​(java.nio.ByteBuffer[] srcs, int offset, int length, java.nio.ByteBuffer dst)`

### Methods inherited from class javax.net.ssl.SSLEngine

`getApplicationProtocol, getHandshakeApplicationProtocol, getHandshakeApplicationProtocolSelector, getHandshakeSession, getPeerHost, getPeerPort, getSSLParameters, setHandshakeApplicationProtocolSelector, setSSLParameters, unwrap, unwrap, wrap, wrap`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### AVAILABLE_CIPHER_SUITES

    public static final java.util.Set<java.lang.String> AVAILABLE_CIPHER_SUITES

#### IMPLEMENTED_PROTOCOLS_SET

    public static final java.util.Set<java.lang.String> IMPLEMENTED_PROTOCOLS_SET

### Method Detail

#### getNegotiatedProtocol

    public java.lang.String getNegotiatedProtocol()

Description copied from interface: `SSLUtil.ProtocolInfo`
ALPN information.

Specified by:
  `getNegotiatedProtocol` in interface `SSLUtil.ProtocolInfo`
Returns:
  the protocol selected using ALPN

#### shutdown

    public void shutdown()

Destroys this engine.

#### wrap

    public javax.net.ssl.SSLEngineResult wrap​(java.nio.ByteBuffer[] srcs,
                                              int offset,
                                              int length,
                                              java.nio.ByteBuffer dst)
                                       throws javax.net.ssl.SSLException

Specified by:
  `wrap` in class `javax.net.ssl.SSLEngine`
Throws:
  `javax.net.ssl.SSLException`

#### unwrap

    public javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer src,
                                                java.nio.ByteBuffer[] dsts,
                                                int offset,
                                                int length)
                                         throws javax.net.ssl.SSLException

Specified by:
  `unwrap` in class `javax.net.ssl.SSLEngine`
Throws:
  `javax.net.ssl.SSLException`

#### getDelegatedTask

    public java.lang.Runnable getDelegatedTask()

Specified by:
  `getDelegatedTask` in class `javax.net.ssl.SSLEngine`

#### closeInbound

    public void closeInbound()
                      throws javax.net.ssl.SSLException

Specified by:
  `closeInbound` in class `javax.net.ssl.SSLEngine`
Throws:
  `javax.net.ssl.SSLException`

#### isInboundDone

    public boolean isInboundDone()

Specified by:
  `isInboundDone` in class `javax.net.ssl.SSLEngine`

#### closeOutbound

    public void closeOutbound()

Specified by:
  `closeOutbound` in class `javax.net.ssl.SSLEngine`

#### isOutboundDone

    public boolean isOutboundDone()

Specified by:
  `isOutboundDone` in class `javax.net.ssl.SSLEngine`

#### getSupportedCipherSuites

    public java.lang.String[] getSupportedCipherSuites()

Specified by:
  `getSupportedCipherSuites` in class `javax.net.ssl.SSLEngine`

#### getEnabledCipherSuites

    public java.lang.String[] getEnabledCipherSuites()

Specified by:
  `getEnabledCipherSuites` in class `javax.net.ssl.SSLEngine`

#### setEnabledCipherSuites

    public void setEnabledCipherSuites​(java.lang.String[] cipherSuites)

Specified by:
  `setEnabledCipherSuites` in class `javax.net.ssl.SSLEngine`

#### getSupportedProtocols

    public java.lang.String[] getSupportedProtocols()

Specified by:
  `getSupportedProtocols` in class `javax.net.ssl.SSLEngine`

#### getEnabledProtocols

    public java.lang.String[] getEnabledProtocols()

Specified by:
  `getEnabledProtocols` in class `javax.net.ssl.SSLEngine`

#### setEnabledProtocols

    public void setEnabledProtocols​(java.lang.String[] protocols)

Specified by:
  `setEnabledProtocols` in class `javax.net.ssl.SSLEngine`

#### getSession

    public javax.net.ssl.SSLSession getSession()

Specified by:
  `getSession` in class `javax.net.ssl.SSLEngine`

#### beginHandshake

    public void beginHandshake()
                        throws javax.net.ssl.SSLException

Specified by:
  `beginHandshake` in class `javax.net.ssl.SSLEngine`
Throws:
  `javax.net.ssl.SSLException`

#### getHandshakeStatus

    public javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()

Specified by:
  `getHandshakeStatus` in class `javax.net.ssl.SSLEngine`

#### setUseClientMode

    public void setUseClientMode​(boolean clientMode)

Specified by:
  `setUseClientMode` in class `javax.net.ssl.SSLEngine`

#### getUseClientMode

    public boolean getUseClientMode()

Specified by:
  `getUseClientMode` in class `javax.net.ssl.SSLEngine`

#### setNeedClientAuth

    public void setNeedClientAuth​(boolean b)

Specified by:
  `setNeedClientAuth` in class `javax.net.ssl.SSLEngine`

#### getNeedClientAuth

    public boolean getNeedClientAuth()

Specified by:
  `getNeedClientAuth` in class `javax.net.ssl.SSLEngine`

#### setWantClientAuth

    public void setWantClientAuth​(boolean b)

Specified by:
  `setWantClientAuth` in class `javax.net.ssl.SSLEngine`

#### getWantClientAuth

    public boolean getWantClientAuth()

Specified by:
  `getWantClientAuth` in class `javax.net.ssl.SSLEngine`

#### setEnableSessionCreation

    public void setEnableSessionCreation​(boolean b)

Specified by:
  `setEnableSessionCreation` in class `javax.net.ssl.SSLEngine`

#### getEnableSessionCreation

    public boolean getEnableSessionCreation()

Specified by:
  `getEnableSessionCreation` in class `javax.net.ssl.SSLEngine`

#### finalize

    protected void finalize()
                     throws java.lang.Throwable

Overrides:
  `finalize` in class `java.lang.Object`
Throws:
  `java.lang.Throwable`