xC: validate server TLS certificate hostname
I haven't actually checked if this takes effect.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user