# SSLSession

<a id="sslsession"></a>

# SSLSession

```cpp
#include <icy/net/sslsession.h>

class SSLSession
```

[Defined in src/net/include/icy/net/sslsession.h:31](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L31)

Cached SSL/TLS session wrapper used for client-side resumption.

For session caching to work, a client must save the session object from an existing connection, if it wants to reuse it with a future connection.

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
| `SSL_SESSION *` | [`sslSession`](#sslsession-1) `const` | Returns the stored OpenSSL SSL_SESSION object. |
|  | [`SSLSession`](#sslsession-2)  | Creates a new [SSLSession](#sslsession) wrapping the given OpenSSL session object. |
|  | [`~SSLSession`](#sslsession-3) `noexcept` | Destroys the Session. |
|  | [`SSLSession`](#sslsession-4)  | Constructs an empty [SSLSession](#sslsession) with a null session pointer. |
|  | [`SSLSession`](#sslsession-5)  | Deleted constructor. |
| [`SSLSession`](#sslsession) & | [`operator=`](#operator-187)  | Deleted assignment operator. |
|  | [`SSLSession`](#sslsession-6)  | Deleted constructor. |
| [`SSLSession`](#sslsession) & | [`operator=`](#operator-188)  | Deleted assignment operator. |

---

<a id="sslsession-1"></a>

### sslSession

`const`

```cpp
SSL_SESSION * sslSession() const
```

[Defined in src/net/include/icy/net/sslsession.h:37](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L37)

Returns the stored OpenSSL SSL_SESSION object.

---

<a id="sslsession-2"></a>

### SSLSession

```cpp
SSLSession(SSL_SESSION * ptr)
```

[Defined in src/net/include/icy/net/sslsession.h:44](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L44)

Creates a new [SSLSession](#sslsession) wrapping the given OpenSSL session object.

The SSL_SESSION's reference count is not incremented; the [SSLSession](#sslsession) takes ownership and will call SSL_SESSION_free() on destruction.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `ptr` | `SSL_SESSION *` | The OpenSSL session object to wrap. |

---

<a id="sslsession-3"></a>

### ~SSLSession

`noexcept`

```cpp
~SSLSession() noexcept
```

[Defined in src/net/include/icy/net/sslsession.h:50](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L50)

Destroys the Session.

Calls SSL_SESSION_free() on the stored SSL_SESSION object.

---

<a id="sslsession-4"></a>

### SSLSession

```cpp
SSLSession()
```

[Defined in src/net/include/icy/net/sslsession.h:53](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L53)

Constructs an empty [SSLSession](#sslsession) with a null session pointer.

---

<a id="sslsession-5"></a>

### SSLSession

```cpp
SSLSession(const SSLSession &) = delete
```

[Defined in src/net/include/icy/net/sslsession.h:55](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L55)

Deleted constructor.

---

<a id="operator-187"></a>

### operator=

```cpp
SSLSession & operator=(const SSLSession &) = delete
```

[Defined in src/net/include/icy/net/sslsession.h:56](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L56)

Deleted assignment operator.

---

<a id="sslsession-6"></a>

### SSLSession

```cpp
SSLSession(SSLSession &&) = delete
```

[Defined in src/net/include/icy/net/sslsession.h:57](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L57)

Deleted constructor.

---

<a id="operator-188"></a>

### operator=

```cpp
SSLSession & operator=(SSLSession &&) = delete
```

[Defined in src/net/include/icy/net/sslsession.h:58](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L58)

Deleted assignment operator.

## Protected Attributes

| Return | Name | Description |
|--------|------|-------------|
| `SSL_SESSION *` | [`_ptr`](#_ptr-2)  |  |

---

<a id="_ptr-2"></a>

### _ptr

```cpp
SSL_SESSION * _ptr
```

[Defined in src/net/include/icy/net/sslsession.h:61](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L61)

## Public Types

| Name | Description |
|------|-------------|
| [`Ptr`](#ptr-12)  |  |

---

<a id="ptr-12"></a>

### Ptr

```cpp
using Ptr = std::shared_ptr< SSLSession >
```

Type: std::shared_ptr< [`SSLSession`](#sslsession) >

[Defined in src/net/include/icy/net/sslsession.h:34](https://github.com/auscaster/icey/blob/main/src/net/include/icy/net/sslsession.h#L34)
