diff options
author | jsing <> | 2016-08-01 17:32:19 +0000 |
---|---|---|
committer | jsing <> | 2016-08-01 17:32:19 +0000 |
commit | b75dcc327d73d0f5f00f1367a7d98e3979ddbd9f (patch) | |
tree | e03f60ab444ada6f737a380e17e8eba68f90a817 /src/lib/libtls/tls.c | |
parent | a37dd8e8e7691f9cc5b065e47b95a2c75eb96512 (diff) | |
download | openbsd-b75dcc327d73d0f5f00f1367a7d98e3979ddbd9f.tar.gz openbsd-b75dcc327d73d0f5f00f1367a7d98e3979ddbd9f.tar.bz2 openbsd-b75dcc327d73d0f5f00f1367a7d98e3979ddbd9f.zip |
Add ALPN support to libtls.
ok beck@ doug@
Diffstat (limited to 'src/lib/libtls/tls.c')
-rw-r--r-- | src/lib/libtls/tls.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.c b/src/lib/libtls/tls.c index 857b8d0811..2584ceb88b 100644 --- a/src/lib/libtls/tls.c +++ b/src/lib/libtls/tls.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls.c,v 1.41 2016/07/07 14:09:03 jsing Exp $ */ | 1 | /* $OpenBSD: tls.c,v 1.42 2016/08/01 17:32:19 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) { |