Posh-ACME icon indicating copy to clipboard operation
Posh-ACME copied to clipboard

PFX files generated cannot be used by OpenSSL 3.x without enabling legacy mode

Open ChlorideCull opened this issue 1 year ago • 4 comments

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.

ChlorideCull avatar Aug 05 '22 09:08 ChlorideCull

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

webprofusion-chrisc avatar Aug 05 '22 09:08 webprofusion-chrisc

See also https://community.certifytheweb.com/t/fyi-pks-bundled-certificates-do-not-natively-work-with-openssl-v3-x/1821

webprofusion-chrisc avatar Aug 05 '22 09:08 webprofusion-chrisc

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.

ChlorideCull avatar Aug 05 '22 10:08 ChlorideCull

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.

rmbolger avatar Aug 05 '22 20:08 rmbolger

I'm going to leave this open until I actually push a new release with the merged fix.

rmbolger avatar Aug 24 '22 17:08 rmbolger

Fix is now live in 4.15.0

rmbolger avatar Aug 27 '22 00:08 rmbolger