summaryrefslogtreecommitdiff
path: root/src/lib/libressl/ressl_client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libressl/ressl_client.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libressl/ressl_client.c b/src/lib/libressl/ressl_client.c
index 8723a35ae0..013963f3a1 100644
--- a/src/lib/libressl/ressl_client.c
+++ b/src/lib/libressl/ressl_client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ressl_client.c,v 1.4 2014/09/29 15:11:29 jsing Exp $ */ 1/* $OpenBSD: ressl_client.c,v 1.5 2014/10/03 14:14:40 tedu Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -142,12 +142,14 @@ ressl_connect_socket(struct ressl *ctx, int socket, const char *hostname)
142 if (ressl_configure_ssl(ctx) != 0) 142 if (ressl_configure_ssl(ctx) != 0)
143 goto err; 143 goto err;
144 144
145 if (ctx->config->verify) { 145 if (ctx->config->verify_host) {
146 if (hostname == NULL) { 146 if (hostname == NULL) {
147 ressl_set_error(ctx, "server name not specified"); 147 ressl_set_error(ctx, "server name not specified");
148 goto err; 148 goto err;
149 } 149 }
150 }
150 151
152 if (ctx->config->verify_cert) {
151 SSL_CTX_set_verify(ctx->ssl_ctx, SSL_VERIFY_PEER, NULL); 153 SSL_CTX_set_verify(ctx->ssl_ctx, SSL_VERIFY_PEER, NULL);
152 154
153 if (SSL_CTX_load_verify_locations(ctx->ssl_ctx, 155 if (SSL_CTX_load_verify_locations(ctx->ssl_ctx,
@@ -188,7 +190,7 @@ ressl_connect_socket(struct ressl *ctx, int socket, const char *hostname)
188 goto err; 190 goto err;
189 } 191 }
190 192
191 if (ctx->config->verify) { 193 if (ctx->config->verify_host) {
192 cert = SSL_get_peer_certificate(ctx->ssl_conn); 194 cert = SSL_get_peer_certificate(ctx->ssl_conn);
193 if (cert == NULL) { 195 if (cert == NULL) {
194 ressl_set_error(ctx, "no server certificate"); 196 ressl_set_error(ctx, "no server certificate");