Skip to content

Commit

Permalink
Fixing return of error in sqSetupSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Aug 4, 2021
1 parent 192ac2a commit 557e775
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions extracted/plugins/SqueakSSL/src/unix/sqUnixSSL.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ sqInt sqSetupSSL(sqSSL *ssl, int server) {
logTrace("sqSetupSSL: Disabling SSLv2 and SSLv3\n");
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);

if(!ssl->ctx) ERR_print_errors_fp(stdout);
if(!ssl->ctx) {
ERR_print_errors_fp(stdout);
return 0;
}

logTrace("sqSetupSSL: setting cipher list\n");
SSL_CTX_set_cipher_list(ssl->ctx, "!ADH:HIGH:MEDIUM:@STRENGTH");
Expand All @@ -261,16 +264,20 @@ sqInt sqSetupSSL(sqSSL *ssl, int server) {

if(SSL_CTX_use_certificate_file(ssl->ctx, ssl->certName, SSL_FILETYPE_PEM)<=0) {
ERR_print_errors_fp(stderr);
return 0;
}
if(SSL_CTX_use_PrivateKey_file(ssl->ctx, ssl->certName, SSL_FILETYPE_PEM)<=0) {
ERR_print_errors_fp(stderr);
return 0;
}
}

/* Set up trusted CA */
logTrace("sqSetupSSL: No root CA given; using default verify paths\n");
if(SSL_CTX_set_default_verify_paths(ssl->ctx) <=0)
if(SSL_CTX_set_default_verify_paths(ssl->ctx) <=0){
ERR_print_errors_fp(stderr);
return 0;
}

logTrace("sqSetupSSL: Creating SSL\n");
ssl->ssl = SSL_new(ssl->ctx);
Expand Down

0 comments on commit 557e775

Please sign in to comment.