mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
res_http_websocket.c: Set hostname on client for certificate validation.
Additionally add a `assert()` to in the TLS client setup code to
ensure that hostname is set when it is supposed to be.
Fixes #433
(cherry picked from commit 40a9f5a88c
)
This commit is contained in:
committed by
Asterisk Development Team
parent
6142e38125
commit
a44fde08dd
@@ -1163,6 +1163,12 @@ static struct ast_tcptls_session_args *websocket_client_args_create(
|
||||
}
|
||||
ast_sockaddr_copy(&args->remote_address, addr);
|
||||
ast_free(addr);
|
||||
|
||||
/* We need to save off the hostname but it may contain a port spec */
|
||||
snprintf(args->hostname, sizeof(args->hostname),
|
||||
"%.*s",
|
||||
(int) strcspn(host, ":"), host);
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user