summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libtls/tls.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.c b/src/lib/libtls/tls.c
index ddf847d390..4d4910d128 100644
--- a/src/lib/libtls/tls.c
+++ b/src/lib/libtls/tls.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls.c,v 1.43 2016/08/02 07:47:11 jsing Exp $ */ 1/* $OpenBSD: tls.c,v 1.44 2016/08/12 15:10:59 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -310,6 +310,14 @@ tls_configure_ssl(struct tls *ctx)
310 if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_2) == 0) 310 if ((ctx->config->protocols & TLS_PROTOCOL_TLSv1_2) == 0)
311 SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_TLSv1_2); 311 SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_TLSv1_2);
312 312
313 if (ctx->config->alpn != NULL) {
314 if (SSL_CTX_set_alpn_protos(ctx->ssl_ctx, ctx->config->alpn,
315 ctx->config->alpn_len) != 0) {
316 tls_set_errorx(ctx, "failed to set alpn");
317 goto err;
318 }
319 }
320
313 if (ctx->config->ciphers != NULL) { 321 if (ctx->config->ciphers != NULL) {
314 if (SSL_CTX_set_cipher_list(ctx->ssl_ctx, 322 if (SSL_CTX_set_cipher_list(ctx->ssl_ctx,
315 ctx->config->ciphers) != 1) { 323 ctx->config->ciphers) != 1) {