io.undertow.server

## Class BasicSSLSessionInfo

- java.lang.Object
- - io.undertow.server.BasicSSLSessionInfo

All Implemented Interfaces:
  SSLSessionInfo

    public class BasicSSLSessionInfo
    extends Object
    implements SSLSessionInfo

Basic SSL session information. This information is generally provided by a front end proxy.

Author:
  Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`BasicSSLSessionInfo(byte[] sessionId, String cypherSuite, String certificate)`
`BasicSSLSessionInfo(byte[] sessionId, String cypherSuite, String certificate, Integer keySize)`
`BasicSSLSessionInfo(String sessionId, String cypherSuite, String certificate)`
`BasicSSLSessionInfo(String sessionId, String cypherSuite, String certificate, Integer keySize)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getCipherSuite()`
`int` `getKeySize()`
`X509Certificate[]` `getPeerCertificateChain()` This method is no longer supported on java 15 and should be avoided.
`Certificate[]` `getPeerCertificates()` Gets the peer certificates.
`byte[]` `getSessionId()`
`SSLSession` `getSSLSession()`
`void` `renegotiate(HttpServerExchange exchange, org.xnio.SslClientAuthMode sslClientAuthMode)` Renegotiate in a blocking manner.

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

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

### Methods inherited from interface io.undertow.server.SSLSessionInfo

`calculateKeySize`

### Constructor Detail

#### BasicSSLSessionInfo

    public BasicSSLSessionInfo(byte[] sessionId,
                               String cypherSuite,
                               String certificate,
                               Integer keySize)
                        throws CertificateException,
                               CertificateException

Parameters:
  `sessionId` - The SSL session ID
  `cypherSuite` - The cypher suite name
  `certificate` - A string representation of the client certificate
  `keySize` - The key-size used by the cypher
Throws:
  `CertificateException` - If the client cert could not be decoded
  `CertificateException` - If the client cert could not be decoded

#### BasicSSLSessionInfo

    public BasicSSLSessionInfo(byte[] sessionId,
                               String cypherSuite,
                               String certificate)
                        throws CertificateException,
                               CertificateException

Parameters:
  `sessionId` - The SSL session ID
  `cypherSuite` - The cypher suite name
  `certificate` - A string representation of the client certificate
Throws:
  `CertificateException` - If the client cert could not be decoded
  `CertificateException` - If the client cert could not be decoded

#### BasicSSLSessionInfo

    public BasicSSLSessionInfo(String sessionId,
                               String cypherSuite,
                               String certificate)
                        throws CertificateException,
                               CertificateException

Parameters:
  `sessionId` - The encoded SSL session ID
  `cypherSuite` - The cypher suite name
  `certificate` - A string representation of the client certificate
Throws:
  `CertificateException` - If the client cert could not be decoded
  `CertificateException` - If the client cert could not be decoded

#### BasicSSLSessionInfo

    public BasicSSLSessionInfo(String sessionId,
                               String cypherSuite,
                               String certificate,
                               Integer keySize)
                        throws CertificateException,
                               CertificateException

Parameters:
  `sessionId` - The encoded SSL session ID
  `cypherSuite` - The cypher suite name
  `certificate` - A string representation of the client certificate
  `keySize` - The key-size used by the cypher
Throws:
  `CertificateException` - If the client cert could not be decoded
  `CertificateException` - If the client cert could not be decoded

### Method Detail

#### getSessionId

    public byte[] getSessionId()

Specified by:
  `getSessionId` in interface `SSLSessionInfo`
Returns:
  The SSL session ID, or null if this could not be determined.

#### getCipherSuite

    public String getCipherSuite()

Specified by:
  `getCipherSuite` in interface `SSLSessionInfo`

#### getKeySize

    public int getKeySize()

Specified by:
  `getKeySize` in interface `SSLSessionInfo`

#### getPeerCertificates

    public Certificate[] getPeerCertificates()
                                      throws SSLPeerUnverifiedException

Description copied from interface: `SSLSessionInfo`
Gets the peer certificates. This may force SSL renegotiation.

Specified by:
  `getPeerCertificates` in interface `SSLSessionInfo`
Returns:
  The peer certificates
Throws:
  `SSLPeerUnverifiedException`

#### getPeerCertificateChain

    public X509Certificate[] getPeerCertificateChain()
                                              throws SSLPeerUnverifiedException

Description copied from interface: `SSLSessionInfo`
This method is no longer supported on java 15 and should be avoided.

Specified by:
  `getPeerCertificateChain` in interface `SSLSessionInfo`
Throws:
  `SSLPeerUnverifiedException`
See Also:
  `SSLSession.getPeerCertificateChain()`

#### renegotiate

    public void renegotiate(HttpServerExchange exchange,
                            org.xnio.SslClientAuthMode sslClientAuthMode)
                     throws IOException

Description copied from interface: `SSLSessionInfo`
Renegotiate in a blocking manner. This will set the client aut TODO: we also need a non-blocking version

Specified by:
  `renegotiate` in interface `SSLSessionInfo`
Parameters:
  `exchange` - The exchange
  `sslClientAuthMode` - The client cert mode to use when renegotiating
Throws:
  `IOException`

#### getSSLSession

    public SSLSession getSSLSession()

Specified by:
  `getSSLSession` in interface `SSLSessionInfo`
Returns:
  The SSL session, or null if it is not applicable