diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-08-04 00:28:54 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-08-04 00:28:54 (EDT) |
commit | 812a2c21eed8882ba5958e2ddf103e42ecf887af (patch) | |
tree | 71fa373b7773781337c43bfad4c1b9d40d7ad2db | |
parent | fe26e2e6791333e1b2e5ac5da54bc7120ed89dc5 (diff) |
s_client: Merge more conditionals
-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; |