diff options
-rw-r--r-- | src/s_client.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/s_client.c b/src/s_client.c index bf82841..2387474 100644 --- a/src/s_client.c +++ b/src/s_client.c @@ -213,22 +213,9 @@ s_client(int argc, char **argv) wolfSSL_Init(); - if ((method = wolfTLSv1_2_client_method()) == NULL || - (ctx = wolfSSL_CTX_new(method)) == NULL) { - fputs("Out of memory\n", stderr); - goto error; - } - -#if defined(HAVE_CA_CERTS) && HAVE_CA_CERTS - if (wolfSSL_CTX_load_verify_locations_ex(ctx, NULL, CA_CERTS, - WOLFSSL_LOAD_FLAG_IGNORE_ERR) != - WOLFSSL_SUCCESS) { - fputs("Failed to load CA certificates\n", stderr); - goto error; - } -#endif - if ( + (method = wolfTLSv1_2_client_method()) == NULL || + (ctx = wolfSSL_CTX_new(method)) == NULL || #ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2 wolfSSL_CTX_EnableOCSPStapling(ctx) != WOLFSSL_SUCCESS || wolfSSL_CTX_UseOCSPStaplingV2(ctx, @@ -261,6 +248,15 @@ s_client(int argc, char **argv) goto error; } +#if defined(HAVE_CA_CERTS) && HAVE_CA_CERTS + if (wolfSSL_CTX_load_verify_locations_ex(ctx, NULL, CA_CERTS, + WOLFSSL_LOAD_FLAG_IGNORE_ERR) != + WOLFSSL_SUCCESS) { + fputs("Failed to load CA certificates\n", stderr); + goto error; + } +#endif + sfd = connect_socket(host, port); if (sfd == -1) { goto error; |