summaryrefslogtreecommitdiff
path: root/lib/libtls/tls.h
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2016-08-22 14:56:00 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2016-08-22 14:56:00 +0000
commit46831400e57220bc21374209a8c171ea715ce269 (patch)
treea8f7789e6acef99330639d391e301625f793b487 /lib/libtls/tls.h
parentac71baeab4adecbe7281786561cf09110ca5ee32 (diff)
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 'lib/libtls/tls.h')
-rw-r--r--lib/libtls/tls.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libtls/tls.h b/lib/libtls/tls.h
index 13df43f0461..7a68c3d0d36 100644
--- a/lib/libtls/tls.h
+++ b/lib/libtls/tls.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.h,v 1.33 2016/08/12 15:10:59 jsing Exp $ */
+/* $OpenBSD: tls.h,v 1.34 2016/08/22 14:55:59 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -52,6 +52,11 @@ const char *tls_error(struct tls *_ctx);
struct tls_config *tls_config_new(void);
void tls_config_free(struct tls_config *_config);
+int tls_config_add_keypair_file(struct tls_config *_config,
+ const char *_cert_file, const char *_key_file);
+int 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);
+
int tls_config_set_alpn(struct tls_config *_config, const char *_alpn);
int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file);
int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path);
@@ -119,6 +124,7 @@ time_t tls_peer_cert_notafter(struct tls *_ctx);
const char *tls_conn_alpn_selected(struct tls *_ctx);
const char *tls_conn_cipher(struct tls *_ctx);
+const char *tls_conn_servername(struct tls *_ctx);
const char *tls_conn_version(struct tls *_ctx);
uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password);