summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_init.3
diff options
context:
space:
mode:
authorjsing <>2016-08-22 14:55:59 +0000
committerjsing <>2016-08-22 14:55:59 +0000
commit9471125540d25a0117670bd41ea6c3a0ff7844eb (patch)
treeb381f554fd76ea61d743e75d83ea05d769d71108 /src/lib/libtls/tls_init.3
parent74ebdd842595c2d6c66a0aa102dc5c4b98412c8d (diff)
downloadopenbsd-9471125540d25a0117670bd41ea6c3a0ff7844eb.tar.gz
openbsd-9471125540d25a0117670bd41ea6c3a0ff7844eb.tar.bz2
openbsd-9471125540d25a0117670bd41ea6c3a0ff7844eb.zip
Provide an API that enables server side SNI support - add the ability to
provide additional keypairs (via tls_config_add_keypair_{file,mem}()) and allow the server to determine what servername the client requested (via tls_conn_servername()). ok beck@
Diffstat (limited to 'src/lib/libtls/tls_init.3')
-rw-r--r--src/lib/libtls/tls_init.329
1 files changed, 27 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3
index cd98450035..4d7367408b 100644
--- a/src/lib/libtls/tls_init.3
+++ b/src/lib/libtls/tls_init.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: tls_init.3,v 1.66 2016/08/18 15:43:12 jsing Exp $ 1.\" $OpenBSD: tls_init.3,v 1.67 2016/08/22 14:55:59 jsing Exp $
2.\" 2.\"
3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: August 18 2016 $ 17.Dd $Mdocdate: August 22 2016 $
18.Dt TLS_INIT 3 18.Dt TLS_INIT 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -24,6 +24,8 @@
24.Nm tls_config_new , 24.Nm tls_config_new ,
25.Nm tls_config_free , 25.Nm tls_config_free ,
26.Nm tls_config_parse_protocols , 26.Nm tls_config_parse_protocols ,
27.Nm tls_config_add_keypair_file ,
28.Nm tls_config_add_keypair_mem ,
27.Nm tls_config_set_alpn , 29.Nm tls_config_set_alpn ,
28.Nm tls_config_set_ca_file , 30.Nm tls_config_set_ca_file ,
29.Nm tls_config_set_ca_path , 31.Nm tls_config_set_ca_path ,
@@ -57,6 +59,7 @@
57.Nm tls_peer_cert_notafter , 59.Nm tls_peer_cert_notafter ,
58.Nm tls_conn_alpn_selected , 60.Nm tls_conn_alpn_selected ,
59.Nm tls_conn_cipher , 61.Nm tls_conn_cipher ,
62.Nm tls_conn_servername ,
60.Nm tls_conn_version , 63.Nm tls_conn_version ,
61.Nm tls_load_file , 64.Nm tls_load_file ,
62.Nm tls_client , 65.Nm tls_client ,
@@ -90,6 +93,10 @@
90.Ft "int" 93.Ft "int"
91.Fn tls_config_parse_protocols "uint32_t *protocols" "const char *protostr" 94.Fn tls_config_parse_protocols "uint32_t *protocols" "const char *protostr"
92.Ft "int" 95.Ft "int"
96.Fn tls_config_add_keypair_file "struct tls_config *config" "const char *cert_file" "const char *key_file"
97.Ft "int"
98.Fn tls_config_add_keypair_mem "struct tls_config *config" "const uint8_t *cert" "size_t cert_len" "const uint8_t *key" "size_t key_len"
99.Ft "int"
93.Fn tls_config_set_alpn "struct tls_config *config" "const char *alpn" 100.Fn tls_config_set_alpn "struct tls_config *config" "const char *alpn"
94.Ft "int" 101.Ft "int"
95.Fn tls_config_set_ca_file "struct tls_config *config" "const char *ca_file" 102.Fn tls_config_set_ca_file "struct tls_config *config" "const char *ca_file"
@@ -156,6 +163,8 @@
156.Ft "const char *" 163.Ft "const char *"
157.Fn tls_conn_cipher "struct tls *ctx" 164.Fn tls_conn_cipher "struct tls *ctx"
158.Ft "const char *" 165.Ft "const char *"
166.Fn tls_conn_servername "struct tls *ctx"
167.Ft "const char *"
159.Fn tls_conn_version "struct tls *ctx" 168.Fn tls_conn_version "struct tls *ctx"
160.Ft "uint8_t *" 169.Ft "uint8_t *"
161.Fn tls_load_file "const char *file" "size_t *len" "char *password" 170.Fn tls_load_file "const char *file" "size_t *len" "char *password"
@@ -301,6 +310,16 @@ The following functions modify a configuration by setting parameters (the
301configuration options may only apply to clients, to servers or to both): 310configuration options may only apply to clients, to servers or to both):
302.Bl -bullet -offset four 311.Bl -bullet -offset four
303.It 312.It
313.Fn tls_config_add_keypair_file
314adds an additional public certificate and private key from the specified files,
315used as an alternative certificate for Server Name Indication.
316.Em (Server)
317.It
318.Fn tls_config_set_keypair_mem
319adds an additional public certificate and private key from memory,
320used as an alternative certificate for Server Name Indication.
321.Em (Server)
322.It
304.Fn tls_config_set_alpn 323.Fn tls_config_set_alpn
305sets the ALPN protocols that are supported. 324sets the ALPN protocols that are supported.
306The alpn string is a comma separated list of protocols, in order of preference. 325The alpn string is a comma separated list of protocols, in order of preference.
@@ -445,6 +464,12 @@ connected to
445.Ar ctx . 464.Ar ctx .
446.Em (Server and client) 465.Em (Server and client)
447.It 466.It
467.Fn tls_conn_servername
468returns a string corresponding to the servername that the client connected to
469.Ar ctx
470requested by sending a TLS Server Name Indication extension.
471.Em (Server)
472.It
448.Fn tls_conn_version 473.Fn tls_conn_version
449returns a string corresponding to a TLS version negotiated with the peer 474returns a string corresponding to a TLS version negotiated with the peer
450connected to 475connected to