This commit is contained in:
2025-05-22 23:56:00 -07:00
parent fbd8464043
commit 159428ea76
5 changed files with 105 additions and 67 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <openssl/types.h>
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "TCP.h"
@@ -15,15 +17,18 @@ namespace ehs
class EHS_LIB_IO SSL : public TCP
{
private:
bool server;
SSL_CTX* ctx;
::SSL* sslHdl;
X509 *cert;
EVP_PKEY* pkey;
public:
~SSL() override;
SSL();
SSL(const IP &type);
SSL(const IP &type, const bool &server);
SSL(TCP&& tcp) noexcept;
@@ -49,9 +54,9 @@ namespace ehs
UInt_64 Receive(Byte* const buffer, const UInt_32 size) override;
void UseCertificate(const Byte* data, const UInt_64 size);
void UseCertificate(const Char_8* data, const UInt_32 &size);
void UsePrivateKey(const Byte* data, const UInt_64 size);
void UsePrivateKey(const Char_8* data, const UInt_32 &size);
bool IsValid();
};

View File

@@ -41,6 +41,7 @@ namespace ehs
TEXT_PLAIN,
TEXT_HTML,
TEXT_XML,
IMG_X_ICON,
NONE
};