mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 03:02:15 +00:00
tcptls/iostream: Add support for setting SNI on client TLS connections
If the hostname field of the ast_tcptls_session_args structure is
set (which it is for websocket client connections), that hostname
will now automatically be used in an SNI TLS extension in the client
hello.
Resolves: #713
UserNote: Secure websocket client connections now send SNI in
the TLS client hello.
(cherry picked from commit 9e1a6fa0a7
)
This commit is contained in:
committed by
Asterisk Development Team
parent
824b4ce855
commit
c9439c8ad7
@@ -741,6 +741,13 @@ struct ast_tcptls_session_instance *ast_tcptls_client_create(struct ast_tcptls_s
|
||||
/* Set current info */
|
||||
ast_sockaddr_copy(&desc->old_address, &desc->remote_address);
|
||||
|
||||
if (!ast_strlen_zero(desc->hostname)) {
|
||||
if (ast_iostream_set_sni_hostname(tcptls_session->stream, desc->hostname) != 0) {
|
||||
ast_log(LOG_WARNING, "Unable to set SNI hostname '%s' on connection '%s'\n",
|
||||
desc->hostname, desc->name);
|
||||
}
|
||||
}
|
||||
|
||||
return tcptls_session;
|
||||
|
||||
error:
|
||||
|
Reference in New Issue
Block a user