xC: validate server TLS certificate hostname

I haven't actually checked if this takes effect.
This commit is contained in:
2026-07-21 15:14:49 +02:00
parent b9097f40f6
commit 542f2bca6b
+4
View File
@@ -6131,7 +6131,11 @@ transport_tls_init (struct server *s, const char *hostname, struct error **e)
struct in6_addr dummy;
if (!inet_pton (AF_INET, hostname, &dummy)
&& !inet_pton (AF_INET6, hostname, &dummy))
{
SSL_set_tlsext_host_name (ssl, hostname);
// And to allow certificate validation against the hostname
SSL_set1_host (ssl, hostname);
}
struct transport_tls_data *data = xcalloc (1, sizeof *data);
data->ssl_ctx = ssl_ctx;