use sni in server_name

This commit is contained in:
Aleksey Ryabkov 2020-04-16 17:04:29 +03:00
parent 9e2bdf4429
commit 0189147e99

View file

@ -2669,6 +2669,17 @@ static int decode_server_name_type_host_name(ssl,dir,seg,data)
printf(": %.*s",l,data->data); printf(": %.*s",l,data->data);
/* Possibly use data->data to set/modify ssl->server_name */ /* Possibly use data->data to set/modify ssl->server_name */
if (l!=0)
{
char* server_name;
server_name = calloc(l+1,sizeof(char));
if (server_name != NULL)
{
if (ssl->server_name) free(ssl->server_name);
memcpy(server_name,data->data,l);
ssl->server_name = server_name;
}
}
data->len-=l; data->len-=l;
data->data+=l; data->data+=l;