GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tls: reset secureConnecting on client socket · nodejs/node@eedc131

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • _tls_wrap.js
  • test/parallel
    • test-http2-connect.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/_tls_wrap.js‎

Copy file name to clipboardExpand all lines: lib/_tls_wrap.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,11 +1512,13 @@ function onConnectSecure() {
15121512
debug('client emit secureConnect. rejectUnauthorized: %s, ' +
15131513
'authorizationError: %s', options.rejectUnauthorized,
15141514
this.authorizationError);
1515+
this.secureConnecting = false;
15151516
this.emit('secureConnect');
15161517
}
15171518
} else {
15181519
this.authorized = true;
15191520
debug('client emit secureConnect. authorized:', this.authorized);
1521+
this.secureConnecting = false;
15201522
this.emit('secureConnect');
15211523
}
15221524

Collapse file

‎test/parallel/test-http2-connect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-connect.js
+33-1Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ const {
99
} = require('../common');
1010
if (!hasCrypto)
1111
skip('missing crypto');
12+
const fixtures = require('../common/fixtures');
1213
const assert = require('assert');
13-
const { createServer, connect } = require('http2');
14+
const { createServer, createSecureServer, connect } = require('http2');
1415
const { connect: netConnect } = require('net');
16+
const { connect: tlsConnect } = require('tls');
1517

1618
// Check for session connect callback and event
1719
{
@@ -70,6 +72,36 @@ const { connect: netConnect } = require('net');
7072
connect(authority).on('error', () => {});
7173
}
7274

75+
// Check for session connect callback on already connected TLS socket
76+
{
77+
const serverOptions = {
78+
key: fixtures.readKey('agent1-key.pem'),
79+
cert: fixtures.readKey('agent1-cert.pem')
80+
};
81+
const server = createSecureServer(serverOptions);
82+
server.listen(0, mustCall(() => {
83+
const { port } = server.address();
84+
85+
const onSocketConnect = () => {
86+
const authority = `https://localhost:${port}`;
87+
const createConnection = mustCall(() => socket);
88+
const options = { createConnection };
89+
connect(authority, options, mustCall(onSessionConnect));
90+
};
91+
92+
const onSessionConnect = (session) => {
93+
session.close();
94+
server.close();
95+
};
96+
97+
const clientOptions = {
98+
port,
99+
rejectUnauthorized: false
100+
};
101+
const socket = tlsConnect(clientOptions, mustCall(onSocketConnect));
102+
}));
103+
}
104+
73105
// Check for error for init settings error
74106
{
75107
createServer(function() {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.