summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-01-28 13:17:25 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-01-28 13:17:25 +0000
commita027959a7fe49483acf86bd65d4266e3cbc4d0b0 (patch)
tree4a3f23cd34d53a33c1e08374a4911e827bcbd669 /src
parent0545d612be4529492a86a98b5f066d58d7c9436a (diff)
downloads6-networking-a027959a7fe49483acf86bd65d4266e3cbc4d0b0.tar.xz
Prepare for 2.4.1.0; add SSL_TLS_SNI_SERVERNAME
Diffstat (limited to 'src')
-rw-r--r--src/sbearssl/sbearssl_send_environment.c3
-rw-r--r--src/stls/stls_send_environment.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/src/sbearssl/sbearssl_send_environment.c b/src/sbearssl/sbearssl_send_environment.c
index 3e1f1e1..2439351 100644
--- a/src/sbearssl/sbearssl_send_environment.c
+++ b/src/sbearssl/sbearssl_send_environment.c
@@ -25,6 +25,9 @@ int sbearssl_send_environment (br_ssl_engine_context *ctx, int fd)
|| buffer_put(&b, "", 1) < 0
|| buffer_puts(&b, "SSL_CIPHER=") < 0
|| buffer_puts(&b, suite) < 0
+ || buffer_put(&b, "", 1) < 0
+ || buffer_puts(&b, "SSL_TLS_SNI_SERVERNAME=") < 0
+ || buffer_puts(&b, br_ssl_engine_get_server_name(ctx)) < 0
|| buffer_putflush(&b, "\0", 2) < 0)
return 0 ;
return 1 ;
diff --git a/src/stls/stls_send_environment.c b/src/stls/stls_send_environment.c
index 1c13602..af0eeb6 100644
--- a/src/stls/stls_send_environment.c
+++ b/src/stls/stls_send_environment.c
@@ -11,14 +11,18 @@
int stls_send_environment (struct tls *ctx, int fd)
{
+ char const *servername = tls_conn_servername(ctx) ;
char buf[4096] ;
buffer b = BUFFER_INIT(&buffer_write, fd, buf, 4096) ;
+ if (!servername) servername = "" ;
if (buffer_puts(&b, "SSL_PROTOCOL=") < 0
|| buffer_puts(&b, tls_conn_version(ctx)) < 0
|| buffer_put(&b, "", 1) < 0
|| buffer_puts(&b, "SSL_CIPHER=") < 0
|| buffer_puts(&b, tls_conn_cipher(ctx)) < 0
- || buffer_putflush(&b, "\0", 2) < 0)
- return 0 ;
+ || buffer_put(&b, "", 1) < 0
+ || buffer_puts(&b, "SSL_TLS_SNI_SERVERNAME=") < 0
+ || buffer_puts(&b, servername) < 0
+ || buffer_putflush(&b, "\0", 2) < 0) return 0 ;
return 1 ;
}