Commit 95ed45c
authored
Tidy up some irregularities in certificate reloading (#46819)
* Make certificate precedence explicit
1. Values from the user
2. Values set explicitly for test purposes
3. Values from IConfiguration
4. Values from CertificateManager
Note that these are all stored in separate places, so it's possible to "undo" changes if one goes away.
Also, make clearing of the IConfiguration cert on reload explicit.
* Don't update ConfigurationBackedLoaders until reload succeeds
Otherwise, a configuration error - e.g. a bad endpoint certificate password - could cause it to be left in a bad state, causing issues during subsequent reloads.
* Test certificate updates on config reload
* Test setting a bad certificate password in config
* Hack around possible absence of dev cert in store
* Use IsDevCertLoaded to bypass the cert store entirely
* Don't drop untrusted certs
* Fix CanReadAndWriteWithHttpsConnectionMiddlewareWithPemCertificate
* Rename certificate members for consistency1 parent e9ced2f commit 95ed45c
File tree
8 files changed
+230
-69
lines changed- src/Servers/Kestrel
- Core
- src
- test
- Kestrel/test
- test
- BindTests
- InMemory.FunctionalTests
8 files changed
+230
-69
lines changedLines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
| 274 | + | |
273 | 275 | | |
274 | | - | |
275 | 276 | | |
| 277 | + | |
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
| |||
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
339 | | - | |
| 341 | + | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| |||
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
353 | | - | |
| 355 | + | |
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| |||
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
393 | | - | |
394 | 395 | | |
395 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
396 | 405 | | |
397 | 406 | | |
398 | 407 | | |
| |||
404 | 413 | | |
405 | 414 | | |
406 | 415 | | |
407 | | - | |
| 416 | + | |
408 | 417 | | |
409 | 418 | | |
410 | 419 | | |
| |||
414 | 423 | | |
415 | 424 | | |
416 | 425 | | |
417 | | - | |
| 426 | + | |
418 | 427 | | |
419 | 428 | | |
420 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
157 | 165 | | |
158 | 166 | | |
159 | 167 | | |
160 | 168 | | |
161 | | - | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
230 | | - | |
| 238 | + | |
231 | 239 | | |
232 | 240 | | |
233 | 241 | | |
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
237 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
238 | 256 | | |
239 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
240 | 266 | | |
241 | 267 | | |
242 | 268 | | |
| |||
253 | 279 | | |
254 | 280 | | |
255 | 281 | | |
256 | | - | |
257 | | - | |
| 282 | + | |
| 283 | + | |
258 | 284 | | |
259 | 285 | | |
260 | 286 | | |
| |||
280 | 306 | | |
281 | 307 | | |
282 | 308 | | |
283 | | - | |
| 309 | + | |
284 | 310 | | |
285 | | - | |
| 311 | + | |
286 | 312 | | |
287 | | - | |
288 | | - | |
289 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
290 | 317 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 318 | + | |
| 319 | + | |
318 | 320 | | |
319 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
320 | 324 | | |
321 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
322 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
323 | 347 | | |
324 | 348 | | |
325 | 349 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments