mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
src: reuse GetServerName
PR-URL: https://github.com/nodejs/node/pull/43168 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
3bb46f9cd9
commit
eb2c504542
1 file changed
+2
-3
@@ -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 {
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user