Merge pull request #25 from microolap-technologies/sni_2_srv_name

use sni in server_name
This commit is contained in:
Alexandre Dulaunoy 2020-04-23 10:04:41 +02:00 committed by GitHub
commit 36496e31db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;