Repository navigation
Commit 01cd887
authored
chore: surface wrong-passphrase client cert PEM errors consistently in OpenSSL 3 (#33893)
When `clientCertificates` was configured with an encrypted PEM key and the
wrong passphrase, the underlying `createPrivateKey` call could surface either
`ERR_OSSL_BAD_DECRYPT` or `error:1E08010C:DECODER routines::unsupported`
depending on what bytes fell out of the failed decryption (the latter happens
when the decrypted gibberish looks like a partial DER blob the decoder can't
classify). Only the former was translated into the friendly "Cannot decrypt
PEM key with supplied passphrase" message; the latter leaked through as a
generic "Cannot parse PEM key" error.
Also treat the DECODER-unsupported error as a passphrase failure, but only
when the key file actually looks like an encrypted PEM, so a genuinely
malformed key with a passphrase still surfaces "Cannot parse PEM key". This
also de-flakes the EC and RSA invalid-passphrase unit tests (the RSA one had
been `it.skip`'d for this reason and is re-enabled here).1 parent 4534d04 commit 01cd887
2 files changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
278 | 288 | | |
279 | 289 | | |
280 | 290 | | |
| |||
346 | 356 | | |
347 | 357 | | |
348 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
349 | 368 | | |
350 | 369 | | |
351 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
634 | | - | |
| 633 | + | |
635 | 634 | | |
636 | 635 | | |
637 | 636 | | |
| |||
0 commit comments