summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libtls/tls_client.c')
-rw-r--r--src/lib/libtls/tls_client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_client.c b/src/lib/libtls/tls_client.c
index a1bceb7d97..84f4e91740 100644
--- a/src/lib/libtls/tls_client.c
+++ b/src/lib/libtls/tls_client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_client.c,v 1.36 2016/09/04 13:20:56 jsing Exp $ */ 1/* $OpenBSD: tls_client.c,v 1.37 2016/11/02 15:18:42 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -200,6 +200,11 @@ tls_connect_common(struct tls *ctx, const char *servername)
200 SSL_VERIFY_PEER) == -1)) 200 SSL_VERIFY_PEER) == -1))
201 goto err; 201 goto err;
202 202
203 if (SSL_CTX_set_tlsext_status_cb(ctx->ssl_ctx, tls_ocsp_verify_cb) != 1) {
204 tls_set_errorx(ctx, "ssl OCSP verification setup failure");
205 goto err;
206 }
207
203 if ((ctx->ssl_conn = SSL_new(ctx->ssl_ctx)) == NULL) { 208 if ((ctx->ssl_conn = SSL_new(ctx->ssl_ctx)) == NULL) {
204 tls_set_errorx(ctx, "ssl connection failure"); 209 tls_set_errorx(ctx, "ssl connection failure");
205 goto err; 210 goto err;
@@ -210,6 +215,11 @@ tls_connect_common(struct tls *ctx, const char *servername)
210 goto err; 215 goto err;
211 } 216 }
212 217
218 if (SSL_set_tlsext_status_type(ctx->ssl_conn, TLSEXT_STATUSTYPE_ocsp) != 1) {
219 tls_set_errorx(ctx, "ssl OCSP extension setup failure");
220 goto err;
221 }
222
213 /* 223 /*
214 * RFC4366 (SNI): Literal IPv4 and IPv6 addresses are not 224 * RFC4366 (SNI): Literal IPv4 and IPv6 addresses are not
215 * permitted in "HostName". 225 * permitted in "HostName".