diff options
author | jsing <> | 2016-08-12 15:10:59 +0000 |
---|---|---|
committer | jsing <> | 2016-08-12 15:10:59 +0000 |
commit | 5802b7206a96d5d55ba7408d05151a1887b21d28 (patch) | |
tree | d8583e29e61fe2f66ce3df1e84e0afbe16a98d6b /src/lib/libtls/tls.c | |
parent | 7defe424090c084de6c0ba88ff4394fca79f53cd (diff) | |
download | openbsd-5802b7206a96d5d55ba7408d05151a1887b21d28.tar.gz openbsd-5802b7206a96d5d55ba7408d05151a1887b21d28.tar.bz2 openbsd-5802b7206a96d5d55ba7408d05151a1887b21d28.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 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) { |