1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
ULib/include/ulib/ssl/net/ssl_session.h
stefanocasazza b5184ba45e sync
2018-07-27 18:11:02 +02:00

68 lines
1.4 KiB
C++

// ============================================================================
//
// = LIBRARY
// ULib - c++ library
//
// = FILENAME
// ssl_session.h - ssl session utility
//
// = AUTHOR
// Stefano Casazza
//
// ============================================================================
#ifndef ULIB_SSL_SESSION_H
#define ULIB_SSL_SESSION_H 1
#include <ulib/ssl/net/sslsocket.h>
#include <ulib/utility/data_session.h>
/**
* SSL Session Information
*
* This class contains data about an SSL session
*/
class UHTTP;
class UHttpPlugIn;
class U_EXPORT USSLSession : public UDataStorage {
public:
USSLSession()
{
U_TRACE_CTOR(0, USSLSession, "")
}
virtual ~USSLSession() U_DECL_FINAL
{
U_TRACE_DTOR(0, USSLSession)
}
// define method VIRTUAL of class UDataStorage
virtual char* toBuffer() U_DECL_FINAL;
virtual void fromData(const char* ptr, uint32_t len) U_DECL_FINAL;
// SERVICES
#if defined(DEBUG) && defined(U_STDCPP_ENABLE)
const char* dump(bool reset) const { return UDataStorage::dump(reset); }
#endif
private:
static SSL_SESSION* sess;
static int newSession(SSL* ssl, SSL_SESSION* sess);
static void removeSession(SSL_CTX* ctx, SSL_SESSION* sess);
static SSL_SESSION* getSession(SSL* ssl, unsigned char* id, int len, int* copy);
U_DISALLOW_COPY_AND_ASSIGN(USSLSession)
friend class UHTTP;
friend class UHttpPlugIn;
};
#endif