| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 033d0bb commit e049ce2
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -814,6 +814,14 @@ TLSSocket.prototype._init = function(socket, wrap) { | |||
| 814 | 814 | } | |
| 815 | 815 | } | |
| 816 | 816 | ||
| 817 | + // We can only come here via [kWrapConnectedHandle]() call that happens | ||
| 818 | + // if the connection is established with `autoSelectFamily` set to `true`. | ||
| 819 | + const connectOptions = this[kConnectOptions]; | ||
| 820 | + if (!options.isServer && connectOptions) { | ||
| 821 | + if (connectOptions.servername) { | ||
| 822 | + this.setServername(connectOptions.servername); | ||
| 823 | + } | ||
| 824 | + } | ||
| 817 | 825 | ||
| 818 | 826 | if (options.handshakeTimeout > 0) | |
| 819 | 827 | this.setTimeout(options.handshakeTimeout, this._handleTimeout); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,8 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) { | |||
| 80 | 80 | // Test that IPV4 is reached if IPV6 is not reachable | |
| 81 | 81 | { | |
| 82 | 82 | createDnsServer('::1', '127.0.0.1', common.mustCall(function({ dnsServer, lookup }) { | |
| 83 | - const ipv4Server = createServer(options, common.mustCall((_, res) => { | ||
| 83 | + const ipv4Server = createServer(options, common.mustCall((req, res) => { | ||
| 84 | + assert.strictEqual(req.socket.servername, 'example.org'); | ||
| 84 | 85 | res.writeHead(200, { Connection: 'close' }); | |
| 85 | 86 | res.end('response-ipv4'); | |
| 86 | 87 | })); | |
@@ -92,7 +93,8 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) { | |||
| 92 | 93 | lookup, | |
| 93 | 94 | rejectUnauthorized: false, | |
| 94 | 95 | autoSelectFamily: true, | |
| 95 | - autoSelectFamilyAttemptTimeout | ||
| 96 | + autoSelectFamilyAttemptTimeout, | ||
| 97 | + servername: 'example.org', | ||
| 96 | 98 | }, | |
| 97 | 99 | (res) => { | |
| 98 | 100 | assert.strictEqual(res.statusCode, 200); | |
@@ -118,12 +120,14 @@ function createDnsServer(ipv6Addr, ipv4Addr, cb) { | |||
| 118 | 120 | // Test that IPV4 is NOT reached if IPV6 is reachable | |
| 119 | 121 | if (common.hasIPv6) { | |
| 120 | 122 | createDnsServer('::1', '127.0.0.1', common.mustCall(function({ dnsServer, lookup }) { | |
| 121 | - const ipv4Server = createServer(options, common.mustNotCall((_, res) => { | ||
| 123 | + const ipv4Server = createServer(options, common.mustNotCall((req, res) => { | ||
| 124 | + assert.strictEqual(req.socket.servername, 'example.org'); | ||
| 122 | 125 | res.writeHead(200, { Connection: 'close' }); | |
| 123 | 126 | res.end('response-ipv4'); | |
| 124 | 127 | })); | |
| 125 | 128 | ||
| 126 | - const ipv6Server = createServer(options, common.mustCall((_, res) => { | ||
| 129 | + const ipv6Server = createServer(options, common.mustCall((req, res) => { | ||
| 130 | + assert.strictEqual(req.socket.servername, 'example.org'); | ||
| 127 | 131 | res.writeHead(200, { Connection: 'close' }); | |
| 128 | 132 | res.end('response-ipv6'); | |
| 129 | 133 | })); | |
@@ -139,6 +143,7 @@ if (common.hasIPv6) { | |||
| 139 | 143 | rejectUnauthorized: false, | |
| 140 | 144 | autoSelectFamily: true, | |
| 141 | 145 | autoSelectFamilyAttemptTimeout, | |
| 146 | + servername: 'example.org', | ||
| 142 | 147 | }, | |
| 143 | 148 | (res) => { | |
| 144 | 149 | assert.strictEqual(res.statusCode, 200); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments