# SSLClient: SSLSession.h Source File

SSLSession.h
Go to the documentation of this file.
/* Copyright 2019 OSU OPEnS Lab
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "bearssl.h"
#include "Arduino.h"
#ifndef SSLSession_H_
#define SSLSession_H_
class SSLSession : public br_ssl_session_parameters {
public:
SSLSession(const char* hostname)
: m_hostname(hostname) {}
const String& get_hostname() const { return m_hostname; }
br_ssl_session_parameters* to_br_session() { return (br_ssl_session_parameters *)this; }
private:
// aparently a hostname has a max length of 256 chars. Go figure.
String m_hostname;
};
#endif /* SSLSession_H_ */
SSLSession
This class stores values which allow SSLClient to save and resume SSL sessions.
Definition: SSLSession.h:51
SSLSession::to_br_session
br_ssl_session_parameters * to_br_session()
Returns a pointer to the ::br_ssl_session_parameters component of this class.
Definition: SSLSession.h:73
SSLSession::SSLSession
SSLSession(const char *hostname)
SSLSession constructor.
Definition: SSLSession.h:59
SSLSession::get_hostname
const String & get_hostname() const
Get the hostname string associated with this session.
Definition: SSLSession.h:70