Commit 757a022
tls: don't treat fatal TLS alerts as EOF
SSL_RECEIVED_SHUTDOWN means not just close_notify or fatal alert. From
what I can tell, this was just a mistake? OnStreamRead's comment
suggests eof_ was intended to be for close_notify.
This fixes a bug in TLSSocket error reporting that seems to have made it
into existing tests. If we receive a fatal alert, EmitRead(UV_EOF)
would, via onConnectEnd in _tls_wrap.js, synthesize an ECONNRESET before
the alert itself is surfaced. As a result, TLS alerts received during
the handshake are misreported by Node.
See the tests that had to be updated as part of this.
PR-URL: #44563
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent c6457cb commit 757a022Copy full SHA for 757a022
File tree
Expand file treeCollapse file tree
7 files changed
+51
-44
lines changedOpen diff view settings
Filter options
- src
- crypto
- test/parallel
Expand file treeCollapse file tree
7 files changed
+51
-44
lines changedOpen diff view settings
Collapse file
+9-14Lines changed: 9 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
728 | 728 | |
729 | 729 | |
730 | 730 | |
731 | | - |
732 | | - |
733 | | - |
734 | | - |
735 | | - |
736 | | - |
737 | | - |
738 | | - |
739 | | - |
740 | | - |
741 | 731 | |
742 | 732 | |
| 733 | + |
743 | 734 | |
744 | 735 | |
745 | | - |
746 | | - |
747 | | - |
748 | | - |
| 736 | + |
| 737 | + |
| 738 | + |
| 739 | + |
| 740 | + |
749 | 741 | |
750 | 742 | |
751 | 743 | |
752 | 744 | |
| 745 | + |
| 746 | + |
753 | 747 | |
754 | 748 | |
| 749 | + |
755 | 750 | |
756 | 751 | |
757 | 752 | |
|
Collapse file
+1-2Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
321 | 321 | |
322 | 322 | |
323 | 323 | |
324 | | - |
325 | | - |
| 324 | + |
326 | 325 | |
327 | 326 | |
328 | 327 | |
|
Collapse file
test/parallel/test-tls-client-auth.js
Copy file name to clipboardExpand all lines: test/parallel/test-tls-client-auth.js+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | | - |
| 82 | + |
| 83 | + |
83 | 84 | |
84 | 85 | |
85 | 86 | |
|
Collapse file
test/parallel/test-tls-empty-sni-context.js
Copy file name to clipboardExpand all lines: test/parallel/test-tls-empty-sni-context.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | | - |
| 29 | + |
30 | 30 | |
31 | 31 | |
Collapse file
test/parallel/test-tls-min-max-version.js
Copy file name to clipboardExpand all lines: test/parallel/test-tls-min-max-version.js+28-15Lines changed: 28 additions & 15 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
120 | 120 | |
121 | 121 | |
122 | 122 | |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
123 | 130 | |
124 | 131 | |
125 | 132 | |
126 | 133 | |
127 | | - |
128 | | - |
| 134 | + |
129 | 135 | |
130 | 136 | |
131 | 137 | |
132 | 138 | |
133 | 139 | |
134 | 140 | |
135 | | - |
136 | | - |
| 141 | + |
137 | 142 | |
138 | | - |
139 | | - |
| 143 | + |
140 | 144 | |
141 | 145 | |
142 | 146 | |
| ||
145 | 149 | |
146 | 150 | |
147 | 151 | |
148 | | - |
| 152 | + |
| 153 | + |
149 | 154 | |
150 | | - |
| 155 | + |
| 156 | + |
151 | 157 | |
152 | 158 | |
153 | 159 | |
| ||
157 | 163 | |
158 | 164 | |
159 | 165 | |
160 | | - |
| 166 | + |
| 167 | + |
161 | 168 | |
162 | 169 | |
163 | 170 | |
| ||
179 | 186 | |
180 | 187 | |
181 | 188 | |
182 | | - |
| 189 | + |
| 190 | + |
183 | 191 | |
184 | | - |
| 192 | + |
| 193 | + |
185 | 194 | |
186 | 195 | |
187 | 196 | |
| ||
191 | 200 | |
192 | 201 | |
193 | 202 | |
194 | | - |
| 203 | + |
| 204 | + |
195 | 205 | |
196 | | - |
| 206 | + |
| 207 | + |
197 | 208 | |
198 | 209 | |
199 | 210 | |
200 | 211 | |
201 | 212 | |
202 | 213 | |
203 | 214 | |
204 | | - |
| 215 | + |
| 216 | + |
205 | 217 | |
206 | 218 | |
207 | 219 | |
| ||
210 | 222 | |
211 | 223 | |
212 | 224 | |
213 | | - |
| 225 | + |
| 226 | + |
214 | 227 | |
215 | 228 | |
216 | 229 | |
|
Collapse file
test/parallel/test-tls-psk-circuit.js
Copy file name to clipboardExpand all lines: test/parallel/test-tls-psk-circuit.js+5-7Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | | - |
| 52 | + |
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | 58 | |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | 59 | |
64 | 60 | |
65 | 61 | |
66 | 62 | |
67 | 63 | |
68 | 64 | |
69 | | - |
| 65 | + |
| 66 | + |
70 | 67 | |
71 | | - |
| 68 | + |
| 69 | + |
72 | 70 | |
Collapse file
test/parallel/test-tls-set-ciphers.js
Copy file name to clipboardExpand all lines: test/parallel/test-tls-set-ciphers.js+5-4Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | | - |
| 91 | + |
92 | 92 | |
93 | | - |
| 93 | + |
| 94 | + |
94 | 95 | |
95 | 96 | |
96 | | - |
| 97 | + |
97 | 98 | |
98 | 99 | |
99 | 100 | |
| ||
109 | 110 | |
110 | 111 | |
111 | 112 | |
112 | | - |
| 113 | + |
113 | 114 | |
114 | 115 | |
115 | 116 | |
|
0 commit comments