Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/sslsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ const char *SSL_error_string(int ssl_error, int orig_ret)

SSL* SSL_new_client()
{
return SSL_new(sip_trp_ssl_ctx_client);
SSL* ssl = SSL_new(sip_trp_ssl_ctx_client);

// Inject the ServerNameIndication (SNI).
// It requires to be a hostname. However, SSL takes whatever we set.
// Ref https://datatracker.ietf.org/doc/html/rfc6066#section-3
if (strcmp(remote_ip, remote_host)) {
SSL_set_tlsext_host_name(ssl, remote_host);
}

return ssl;
}

SSL* SSL_new_server()
Expand Down