origin
steffen 6 years ago
parent 43a2e79418
commit 49709b7915

@ -1,3 +1,6 @@
2019-07-21:
- fixed: compile will work with older versions of SSL.
2019-05-05:
- added SSLSocket support. SSL.Connect (TCP.GetSocket())
it supports as well as non blocking connections with a defined timeout.

@ -53,9 +53,11 @@ int SSLSocket::NewServerCTX() {
if (ctx) SSL_CTX_free(ctx);
ctx = NULL;
#ifdef SSLv23_method
ctx = SSL_CTX_new(TLS_server_method());
#else
ctx = SSL_CTX_new(TLSv1_2_server_method());
#endif
if (SSL_CTX_use_certificate_file(ctx, certfile.c_str(), SSL_FILETYPE_PEM) <= 0 ) {
ERR_print_errors_fp(stderr);
if (ctx) SSL_CTX_free(ctx);
@ -86,7 +88,11 @@ int SSLSocket::NewServerCTX() {
int SSLSocket::NewClientCTX() {
if (ctx) SSL_CTX_free(ctx);
ctx = NULL;
#ifdef SSLv23_method
ctx = SSL_CTX_new(TLS_client_method());
#else
ctx = SSL_CTX_new(TLSv1_2_client_method());
#endif
return 1;
};

@ -6,7 +6,6 @@
#define DEFAULT_PORT 12345
void server () {
TCP tcpserver;
TCP *connection;

Loading…
Cancel
Save