Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
tls: do not default to 'localhost' servername
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Oct 30, 2013
1 parent 5977cba commit ba7c9ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,7 @@ exports.connect = function(/* [port, host], options, cb */) {

var hostname = options.servername ||
options.host ||
options.socket && options.socket._host ||
'localhost',
options.socket && options.socket._host,
NPN = {},
credentials = crypto.createCredentials(options);
tls.convertNPNProtocols(options.NPNProtocols, NPN);
Expand Down
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ void Connection::New(const FunctionCallbackInfo<Value>& args) {
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
if (is_server) {
SSL_CTX_set_tlsext_servername_callback(sc->ctx_, SelectSNIContextCallback_);
} else {
} else if (args[2]->IsString()) {
const String::Utf8Value servername(args[2]);
SSL_set_tlsext_host_name(conn->ssl_, *servername);
}
Expand Down

0 comments on commit ba7c9ce

Please sign in to comment.