Commit 08ac214
test: revise test-tls-econnreset for OpenSSL 1.1.0
This test is testing what happens to the server if the client shuts off
the connection (so the server sees ECONNRESET), but the way it does it
is convoluted. It uses a static RSA key exchange with a tiny (384-bit)
RSA key. The server doesn't notice (since it is static RSA, the client
acts on the key first), so the client tries to encrypt a premaster and
fails:
rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size
SSL routines:ssl3_send_client_key_exchange:bad rsa encrypt
OpenSSL happens not to send an alert in this case, so we get ECONNRESET
with no alert. This is quite fragile and, notably, breaks in OpenSSL
1.1.0 now that small RSA keys are rejected by libssl. Instead, test by
just connecting a TCP socket and immediately closing it.
PR-URL: #16130
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>1 parent d95b608 commit 08ac214Copy full SHA for 08ac214
File tree
Expand file treeCollapse file tree
1 file changed
+10
-54
lines changedOpen diff view settings
Filter options
- test/parallel
Expand file treeCollapse file tree
1 file changed
+10
-54
lines changedOpen diff view settings
Collapse file
test/parallel/test-tls-econnreset.js
Copy file name to clipboardExpand all lines: test/parallel/test-tls-econnreset.js+10-54Lines changed: 10 additions & 54 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
25 | 25 | |
26 | 26 | |
27 | 27 | |
| 28 | + |
| 29 | + |
28 | 30 | |
29 | 31 | |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | 32 | |
69 | | - |
70 | 33 | |
71 | | - |
72 | | - |
73 | | - |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
74 | 38 | |
75 | 39 | |
| 40 | + |
76 | 41 | |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
| 42 | + |
| 43 | + |
86 | 44 | |
87 | | - |
88 | | - |
| 45 | + |
89 | 46 | |
90 | 47 | |
91 | 48 | |
92 | 49 | |
93 | | - |
94 | 50 | |
95 | 51 | |
96 | 52 | |
0 commit comments