Skip to content

Commit 1e2552b

Browse files
tniessenbengl
authored andcommitted
src: reuse GetServerName
PR-URL: #43168 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 1183058 commit 1e2552b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/crypto/crypto_tls.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1250,8 +1250,7 @@ void TLSWrap::GetServername(const FunctionCallbackInfo<Value>& args) {
12501250

12511251
CHECK_NOT_NULL(wrap->ssl_);
12521252

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

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

0 commit comments

Comments
 (0)