EHS/include/ehs/io/socket/SSL.h
Karutoh bcd71cf2b5
All checks were successful
Build & Release / Windows-AMD64-Build (push) Successful in 1m8s
Build & Release / Linux-AMD64-Build (push) Successful in 1m30s
Build & Release / Linux-AARCH64-Build (push) Successful in 3m21s
Adjusted workflow.
2024-02-05 22:25:30 -08:00

56 lines
1.1 KiB
C++

#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();
};
}