Fixed "System::OpenURI". Added SHA256. Added URI safe Base64 methods.
This commit is contained in:
@@ -102,9 +102,21 @@ namespace ehs
|
||||
if (bound)
|
||||
return;
|
||||
|
||||
OpenSSL_add_all_algorithms();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
SSL_load_error_strings();
|
||||
ctx = SSL_CTX_new(SSLv23_server_method());
|
||||
ctx = SSL_CTX_new(TLS_server_method());
|
||||
|
||||
SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION);
|
||||
|
||||
SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!MD5");
|
||||
SSL_CTX_set_ciphersuites(ctx,
|
||||
"TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:"
|
||||
"TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256"
|
||||
);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10101000L
|
||||
SSL_CTX_set_ecdh_auto(ctx, 1);
|
||||
#endif
|
||||
|
||||
sslHdl = SSL_new(ctx);
|
||||
SSL_set_fd(sslHdl, hdl);
|
||||
@@ -143,12 +155,35 @@ namespace ehs
|
||||
return;
|
||||
|
||||
TCP::Connect(address, port);
|
||||
OpenSSL_add_all_algorithms();
|
||||
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
SSL_load_error_strings();
|
||||
ctx = SSL_CTX_new(SSLv23_client_method());
|
||||
|
||||
ctx = SSL_CTX_new(TLS_client_method());
|
||||
if (!ctx)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Failed to creat SSL context.");
|
||||
return;
|
||||
}
|
||||
|
||||
SSL_CTX_set_default_verify_paths(ctx);
|
||||
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, nullptr);
|
||||
SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION);
|
||||
|
||||
sslHdl = SSL_new(ctx);
|
||||
SSL_set_fd(sslHdl, hdl);
|
||||
SSL_connect(sslHdl);
|
||||
|
||||
SSL_set_tlsext_host_name(sslHdl, &address[0]);
|
||||
|
||||
SInt_32 rc = SSL_connect(sslHdl);
|
||||
if (rc != 1)
|
||||
{
|
||||
EHS_LOG_INT(LogType::ERR, 1, "Failed to connect with error #" + Str_8::FromNum(SSL_get_error(sslHdl, rc)) + ".");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
EHS_LOG_SUCCESS();
|
||||
}
|
||||
|
||||
UInt_64 SSL::Send(const Byte* const buffer, const UInt_32 size)
|
||||
|
||||
Reference in New Issue
Block a user