@@ -31,10 +31,17 @@ const max_iter = 20; |
31 | 31 | let iter = 0; |
32 | 32 |
|
33 | 33 | 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); |
35 | 42 | assert.strictEqual(err.library, 'SSL routines'); |
36 | 43 | if (!common.hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record'); |
37 | | - assert.strictEqual(err.reason, 'wrong version number'); |
| 44 | + assert.strictEqual(err.reason, expectedErrorReason); |
38 | 45 | errorReceived = true; |
39 | 46 | if (canCloseServer()) |
40 | 47 | server.close(); |
@@ -87,10 +94,16 @@ function sendBADTLSRecord() { |
87 | 94 | }); |
88 | 95 | })); |
89 | 96 | 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); |
91 | 104 | assert.strictEqual(err.library, 'SSL routines'); |
92 | 105 | if (!common.hasOpenSSL3) |
93 | 106 | assert.strictEqual(err.function, 'ssl3_read_bytes'); |
94 | | - assert.strictEqual(err.reason, 'tlsv1 alert protocol version'); |
| 107 | + assert.strictEqual(err.reason, expectedErrorReason); |
95 | 108 | })); |
96 | 109 | } |