Adjusted workflow.
This commit is contained in:
56
include/ehs/io/socket/SSL.h
Normal file
56
include/ehs/io/socket/SSL.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/EHS.h"
|
||||
#include "ehs/Str.h"
|
||||
#include "TCP.h"
|
||||
#include "Request.h"
|
||||
#include "Response.h"
|
||||
|
||||
typedef struct ssl_ctx_st SSL_CTX;
|
||||
typedef struct ssl_st SSL;
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
/// A class for handling the HTTP(S) TCP socket layer.
|
||||
class SSL : public TCP
|
||||
{
|
||||
private:
|
||||
SSL_CTX* ctx;
|
||||
::SSL* sslHdl;
|
||||
|
||||
public:
|
||||
~SSL() override;
|
||||
|
||||
SSL();
|
||||
|
||||
SSL(const AddrType type);
|
||||
|
||||
SSL(TCP&& tcp) noexcept;
|
||||
|
||||
SSL(const TCP& tcp);
|
||||
|
||||
SSL(const SSL& ssl);
|
||||
|
||||
SSL& operator=(const SSL& ssl);
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
void Release() override;
|
||||
|
||||
void Bind(const Str_8& address, unsigned short port) override;
|
||||
|
||||
SSL* Accept() override;
|
||||
|
||||
void Connect(const Str_8& address, const UInt_16 port) override;
|
||||
|
||||
UInt_64 Send(const Byte* const buffer, const UInt_32 size) override;
|
||||
|
||||
UInt_64 Receive(Byte* const buffer, const UInt_32 size) override;
|
||||
|
||||
void UseCertificate(const Byte* data, const UInt_64 size);
|
||||
|
||||
void UsePrivateKey(const Byte* data, const UInt_64 size);
|
||||
|
||||
bool IsValid();
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user