io.undertow.server.protocol.http

## Class ALPNLimitingSSLEngine

- java.lang.Object
- - javax.net.ssl.SSLEngine
  - - io.undertow.server.protocol.http.ALPNLimitingSSLEngine

    public class ALPNLimitingSSLEngine
    extends SSLEngine

SSLEngine that will limit the cipher selection to HTTP/2 suitable protocols if the client is offering h2 as an option.

In theory this is not a perfect solution to the HTTP/2 cipher strength issue, but in practice it should be sufficient as any RFC compliant implementation should be able to negotiate TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

Author:
  Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`ALPNLimitingSSLEngine(SSLEngine delegate, Runnable invalidAlpnRunnable)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `beginHandshake()`
`void` `closeInbound()`
`void` `closeOutbound()`
`Runnable` `getDelegatedTask()`
`String[]` `getEnabledCipherSuites()`
`String[]` `getEnabledProtocols()`
`boolean` `getEnableSessionCreation()`
`SSLSession` `getHandshakeSession()`
`SSLEngineResult.HandshakeStatus` `getHandshakeStatus()`
`boolean` `getNeedClientAuth()`
`String` `getPeerHost()`
`int` `getPeerPort()`
`SSLSession` `getSession()`
`SSLParameters` `getSSLParameters()`
`String[]` `getSupportedCipherSuites()`
`String[]` `getSupportedProtocols()`
`boolean` `getUseClientMode()`
`boolean` `getWantClientAuth()`
`boolean` `isInboundDone()`
`boolean` `isOutboundDone()`
`void` `setEnabledCipherSuites(String[] strings)`
`void` `setEnabledProtocols(String[] strings)`
`void` `setEnableSessionCreation(boolean b)`
`void` `setNeedClientAuth(boolean b)`
`void` `setSSLParameters(SSLParameters sslParameters)`
`void` `setUseClientMode(boolean b)`
`void` `setWantClientAuth(boolean b)`
`SSLEngineResult` `unwrap(ByteBuffer src, ByteBuffer dst)`
`SSLEngineResult` `unwrap(ByteBuffer src, ByteBuffer[] dsts)`
`SSLEngineResult` `unwrap(ByteBuffer byteBuffer, ByteBuffer[] byteBuffers, int i, int i1)`
`SSLEngineResult` `wrap(ByteBuffer[] srcs, ByteBuffer dst)`
`SSLEngineResult` `wrap(ByteBuffer[] srcs, int off, int len, ByteBuffer dst)`
`SSLEngineResult` `wrap(ByteBuffer src, ByteBuffer dst)`

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

`getApplicationProtocol, getHandshakeApplicationProtocol, getHandshakeApplicationProtocolSelector, setHandshakeApplicationProtocolSelector`

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

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

### Constructor Detail

#### ALPNLimitingSSLEngine

    public ALPNLimitingSSLEngine(SSLEngine delegate,
                                 Runnable invalidAlpnRunnable)

### Method Detail

#### getPeerHost

    public String getPeerHost()

Overrides:
  `getPeerHost` in class `SSLEngine`

#### getPeerPort

    public int getPeerPort()

Overrides:
  `getPeerPort` in class `SSLEngine`

#### wrap

    public SSLEngineResult wrap(ByteBuffer src,
                                ByteBuffer dst)
                         throws SSLException

Overrides:
  `wrap` in class `SSLEngine`
Throws:
  `SSLException`

#### wrap

    public SSLEngineResult wrap(ByteBuffer[] srcs,
                                ByteBuffer dst)
                         throws SSLException

Overrides:
  `wrap` in class `SSLEngine`
Throws:
  `SSLException`

#### unwrap

    public SSLEngineResult unwrap(ByteBuffer src,
                                  ByteBuffer dst)
                           throws SSLException

Overrides:
  `unwrap` in class `SSLEngine`
Throws:
  `SSLException`

#### unwrap

    public SSLEngineResult unwrap(ByteBuffer src,
                                  ByteBuffer[] dsts)
                           throws SSLException

Overrides:
  `unwrap` in class `SSLEngine`
Throws:
  `SSLException`

#### getHandshakeSession

    public SSLSession getHandshakeSession()

Overrides:
  `getHandshakeSession` in class `SSLEngine`

#### getSSLParameters

    public SSLParameters getSSLParameters()

Overrides:
  `getSSLParameters` in class `SSLEngine`

#### setSSLParameters

    public void setSSLParameters(SSLParameters sslParameters)

Overrides:
  `setSSLParameters` in class `SSLEngine`

#### wrap

    public SSLEngineResult wrap(ByteBuffer[] srcs,
                                int off,
                                int len,
                                ByteBuffer dst)
                         throws SSLException

Specified by:
  `wrap` in class `SSLEngine`
Throws:
  `SSLException`

#### unwrap

    public SSLEngineResult unwrap(ByteBuffer byteBuffer,
                                  ByteBuffer[] byteBuffers,
                                  int i,
                                  int i1)
                           throws SSLException

Specified by:
  `unwrap` in class `SSLEngine`
Throws:
  `SSLException`

#### getDelegatedTask

    public Runnable getDelegatedTask()

Specified by:
  `getDelegatedTask` in class `SSLEngine`

#### closeInbound

    public void closeInbound()
                      throws SSLException

Specified by:
  `closeInbound` in class `SSLEngine`
Throws:
  `SSLException`

#### isInboundDone

    public boolean isInboundDone()

Specified by:
  `isInboundDone` in class `SSLEngine`

#### closeOutbound

    public void closeOutbound()

Specified by:
  `closeOutbound` in class `SSLEngine`

#### isOutboundDone

    public boolean isOutboundDone()

Specified by:
  `isOutboundDone` in class `SSLEngine`

#### getSupportedCipherSuites

    public String[] getSupportedCipherSuites()

Specified by:
  `getSupportedCipherSuites` in class `SSLEngine`

#### getEnabledCipherSuites

    public String[] getEnabledCipherSuites()

Specified by:
  `getEnabledCipherSuites` in class `SSLEngine`

#### setEnabledCipherSuites

    public void setEnabledCipherSuites(String[] strings)

Specified by:
  `setEnabledCipherSuites` in class `SSLEngine`

#### getSupportedProtocols

    public String[] getSupportedProtocols()

Specified by:
  `getSupportedProtocols` in class `SSLEngine`

#### getEnabledProtocols

    public String[] getEnabledProtocols()

Specified by:
  `getEnabledProtocols` in class `SSLEngine`

#### setEnabledProtocols

    public void setEnabledProtocols(String[] strings)

Specified by:
  `setEnabledProtocols` in class `SSLEngine`

#### getSession

    public SSLSession getSession()

Specified by:
  `getSession` in class `SSLEngine`

#### beginHandshake

    public void beginHandshake()
                        throws SSLException

Specified by:
  `beginHandshake` in class `SSLEngine`
Throws:
  `SSLException`

#### getHandshakeStatus

    public SSLEngineResult.HandshakeStatus getHandshakeStatus()

Specified by:
  `getHandshakeStatus` in class `SSLEngine`

#### setUseClientMode

    public void setUseClientMode(boolean b)

Specified by:
  `setUseClientMode` in class `SSLEngine`

#### getUseClientMode

    public boolean getUseClientMode()

Specified by:
  `getUseClientMode` in class `SSLEngine`

#### setNeedClientAuth

    public void setNeedClientAuth(boolean b)

Specified by:
  `setNeedClientAuth` in class `SSLEngine`

#### getNeedClientAuth

    public boolean getNeedClientAuth()

Specified by:
  `getNeedClientAuth` in class `SSLEngine`

#### setWantClientAuth

    public void setWantClientAuth(boolean b)

Specified by:
  `setWantClientAuth` in class `SSLEngine`

#### getWantClientAuth

    public boolean getWantClientAuth()

Specified by:
  `getWantClientAuth` in class `SSLEngine`

#### setEnableSessionCreation

    public void setEnableSessionCreation(boolean b)

Specified by:
  `setEnableSessionCreation` in class `SSLEngine`

#### getEnableSessionCreation

    public boolean getEnableSessionCreation()

Specified by:
  `getEnableSessionCreation` in class `SSLEngine`