mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(ext/node): use "localhost" as default tls hostname (#29231)
Fixes https://github.com/denoland/deno/issues/29229
This commit is contained in:
parent
7852806c3a
commit
b14e104306
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,8 @@ export class TLSSocket extends net.Socket {
|
||||||
constructor(socket: any, opts: any = kEmptyObject) {
|
constructor(socket: any, opts: any = kEmptyObject) {
|
||||||
const tlsOptions = { ...opts };
|
const tlsOptions = { ...opts };
|
||||||
|
|
||||||
const hostname = opts.servername ?? opts.host ?? socket._host;
|
const hostname = opts.servername ?? opts.host ?? socket?._host ??
|
||||||
|
"localhost";
|
||||||
tlsOptions.hostname = hostname;
|
tlsOptions.hostname = hostname;
|
||||||
|
|
||||||
const _cert = tlsOptions?.secureContext?.cert;
|
const _cert = tlsOptions?.secureContext?.cert;
|
||||||
|
|
|
@ -71,7 +71,6 @@ Deno.test("tls.connect makes tls connection", async () => {
|
||||||
await delay(200);
|
await delay(200);
|
||||||
|
|
||||||
const conn = tls.connect({
|
const conn = tls.connect({
|
||||||
host: "localhost",
|
|
||||||
port,
|
port,
|
||||||
secureContext: {
|
secureContext: {
|
||||||
ca: rootCaCert,
|
ca: rootCaCert,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue