From 812a2c21eed8882ba5958e2ddf103e42ecf887af Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 04 Aug 2019 00:28:54 -0400 Subject: s_client: Merge more conditionals --- 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; -- cgit v0.9.1