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 — test: adjust tls test for OpenSSL32 · nodejs/node@4092889

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-tls-alert-handling.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-tls-alert-handling.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-alert-handling.js
+17-4Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ const max_iter = 20;
3131
let iter = 0;
3232

3333
const errorHandler = common.mustCall((err) => {
34-
assert.strictEqual(err.code, 'ERR_SSL_WRONG_VERSION_NUMBER');
34+
let expectedErrorCode = 'ERR_SSL_WRONG_VERSION_NUMBER';
35+
let expectedErrorReason = 'wrong version number';
36+
if (common.hasOpenSSL(3, 2)) {
37+
expectedErrorCode = 'ERR_SSL_PACKET_LENGTH_TOO_LONG';
38+
expectedErrorReason = 'packet length too long';
39+
}
40+
41+
assert.strictEqual(err.code, expectedErrorCode);
3542
assert.strictEqual(err.library, 'SSL routines');
3643
if (!common.hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record');
37-
assert.strictEqual(err.reason, 'wrong version number');
44+
assert.strictEqual(err.reason, expectedErrorReason);
3845
errorReceived = true;
3946
if (canCloseServer())
4047
server.close();
@@ -87,10 +94,16 @@ function sendBADTLSRecord() {
8794
});
8895
}));
8996
client.on('error', common.mustCall((err) => {
90-
assert.strictEqual(err.code, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION');
97+
let expectedErrorCode = 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION';
98+
let expectedErrorReason = 'tlsv1 alert protocol version';
99+
if (common.hasOpenSSL(3, 2)) {
100+
expectedErrorCode = 'ERR_SSL_TLSV1_ALERT_RECORD_OVERFLOW';
101+
expectedErrorReason = 'tlsv1 alert record overflow';
102+
}
103+
assert.strictEqual(err.code, expectedErrorCode);
91104
assert.strictEqual(err.library, 'SSL routines');
92105
if (!common.hasOpenSSL3)
93106
assert.strictEqual(err.function, 'ssl3_read_bytes');
94-
assert.strictEqual(err.reason, 'tlsv1 alert protocol version');
107+
assert.strictEqual(err.reason, expectedErrorReason);
95108
}));
96109
}

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.