Posh-ACME
Posh-ACME copied to clipboard
PFX files generated cannot be used by OpenSSL 3.x without enabling legacy mode
The version of BouncyCastle used generates a PKCS12 file that uses RC2-40-CBC for encrypting certificates, which isn't really useful for encryption these days - 40 bit RC2 isn't that strong.
OpenSSL 3.x hasn't made a new implementation, instead relegating it to the legacy implementation, which is opt-in.
This can be fixed by using Pkcs12StoreBuilder
and telling it to use PbeWithShaAnd3KeyTripleDesCbc
for certificates, instead of creating the Pkcs12Store
directly.
Note that 3DES isn't exactly the best these days, but I don't know if BouncyCastle handles AES256 correctly in PFX, or how to use it.
I'd like to figure out that out as well.
I started a related discussion about this on the BouncyCastle github a few days ago but I don't really expect a response https://github.com/bcgit/bc-csharp/discussions/372
See also https://community.certifytheweb.com/t/fyi-pks-bundled-certificates-do-not-natively-work-with-openssl-v3-x/1821
Hah, funnily enough I was going to respond to your discussion now that I've figured it out, I've also created #447 to fix it here. I'll give the technical details in the discussion post.
Thanks for the research and fix for this @ChlorideCull. I'm out of town at the moment and not in a great place to test stuff. But when I get back I'll have a look.
I'm going to leave this open until I actually push a new release with the merged fix.
Fix is now live in 4.15.0