SSLClient  v1.6.10
SSLSession Class Reference

This class stores values which allow SSLClient to save and resume SSL sessions. More...

#include <SSLSession.h>

Inheritance diagram for SSLSession:

Public Member Functions

 SSLSession (const char *hostname)
 SSLSession constructor. More...
 
const String & get_hostname () const
 Get the hostname string associated with this session. More...
 
br_ssl_session_parameters * to_br_session ()
 Returns a pointer to the ::br_ssl_session_parameters component of this class. More...
 

Detailed Description

This class stores values which allow SSLClient to save and resume SSL sessions.

SSLSession.h

This file contains a simple utility class to store parameters about an SSL Session for reuse later.

This class was created to extend the values stored in br_ssl_session_parameters, which allow BearSSL to resume an SSL session. When testing BearSSL's session resumption feature, it was observed that BearSSL can only resume a session that was was started with the same server. This becomes an issue when using repeated requests to a domain name which can resolve to multiple IP addresses ("api.github.com"), as the device will switch between two or three servers. Since BearSSL only stores one session at a time, this results in session resumption being few and far between.

To remedy this problem, an SSLSession stores the IPAddress and hostname, along with the parameters in br_ssl_session_parameters struct. Using this data, SSLClient is able to remember which IPAddress is associated with which session, allowing it to reconnect to the last IPAddress, as opposed to any associated with the domain.

Constructor & Destructor Documentation

◆ SSLSession()

SSLSession::SSLSession ( const char *  hostname)
inline

SSLSession constructor.

Sets all parameters to zero, and invalidates the session

Member Function Documentation

◆ get_hostname()

const String& SSLSession::get_hostname ( ) const
inline

Get the hostname string associated with this session.

Returns
A String object or "" if there is no hostname
Precondition
must check isValidSession before getting this value, as if this session in invalid this value is not guarenteed to be reset to "".

◆ to_br_session()

br_ssl_session_parameters* SSLSession::to_br_session ( )
inline

Returns a pointer to the ::br_ssl_session_parameters component of this class.


The documentation for this class was generated from the following file: