mirror of
https://github.com/zebrajr/node.git
synced 2025-12-07 12:20:50 +01:00
tls: do not default to 'localhost' servername
This commit is contained in:
parent
5977cba985
commit
ba7c9ce964
|
|
@ -685,8 +685,7 @@ exports.connect = function(/* [port, host], options, cb */) {
|
||||||
|
|
||||||
var hostname = options.servername ||
|
var hostname = options.servername ||
|
||||||
options.host ||
|
options.host ||
|
||||||
options.socket && options.socket._host ||
|
options.socket && options.socket._host,
|
||||||
'localhost',
|
|
||||||
NPN = {},
|
NPN = {},
|
||||||
credentials = crypto.createCredentials(options);
|
credentials = crypto.createCredentials(options);
|
||||||
tls.convertNPNProtocols(options.NPNProtocols, NPN);
|
tls.convertNPNProtocols(options.NPNProtocols, NPN);
|
||||||
|
|
|
||||||
|
|
@ -1710,7 +1710,7 @@ void Connection::New(const FunctionCallbackInfo<Value>& args) {
|
||||||
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
|
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
|
||||||
if (is_server) {
|
if (is_server) {
|
||||||
SSL_CTX_set_tlsext_servername_callback(sc->ctx_, SelectSNIContextCallback_);
|
SSL_CTX_set_tlsext_servername_callback(sc->ctx_, SelectSNIContextCallback_);
|
||||||
} else {
|
} else if (args[2]->IsString()) {
|
||||||
const String::Utf8Value servername(args[2]);
|
const String::Utf8Value servername(args[2]);
|
||||||
SSL_set_tlsext_host_name(conn->ssl_, *servername);
|
SSL_set_tlsext_host_name(conn->ssl_, *servername);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user