Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: reuse GetServerName #43168

Merged
merged 1 commit into from
May 21, 2022
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
5 changes: 2 additions & 3 deletions src/crypto/crypto_tls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1250,8 +1250,7 @@ void TLSWrap::GetServername(const FunctionCallbackInfo<Value>& args) {

CHECK_NOT_NULL(wrap->ssl_);

const char* servername = SSL_get_servername(wrap->ssl_.get(),
TLSEXT_NAMETYPE_host_name);
const char* servername = GetServerName(wrap->ssl_.get());
if (servername != nullptr) {
args.GetReturnValue().Set(OneByteString(env->isolate(), servername));
} else {
Expand Down Expand Up @@ -1282,7 +1281,7 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());

const char* servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
const char* servername = GetServerName(s);
if (!Set(env, p->GetOwner(), env->servername_string(), servername))
return SSL_TLSEXT_ERR_NOACK;

Expand Down