Skip to content

Commit

Permalink
Fixing SSL initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Aug 5, 2021
1 parent 557e775 commit f832099
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion extracted/plugins/SqueakSSL/src/unix/sqUnixSSL.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef struct sqSSL {

static sqSSL **handleBuf = NULL;
static sqInt handleMax = 0;
static sqInt initialized = 0;


#define MAX_HOSTNAME_LENGTH 253
Expand Down Expand Up @@ -240,7 +241,16 @@ sqInt sqVerifySAN(sqSSL* ssl, const GENERAL_NAME* sAN, const void* data, const s

/* sqSetupSSL: Common SSL setup tasks */
sqInt sqSetupSSL(sqSSL *ssl, int server) {
/* Fixme. Needs to use specified version */
if(!initialized){
#if OPENSSL_VERSION_NUMBER < 0x10100000L
logTrace("Initializing using SSL_library_init");
SSL_library_init();
#else
logTrace("Initializing using OPENSSL_init_ssl");
OPENSSL_init_ssl(0, NULL);
#endif
}

logTrace("sqSetupSSL: setting method\n");

ssl->method = (SSL_METHOD*) SSLv23_method();
Expand Down

0 comments on commit f832099

Please sign in to comment.