Search code examples
openssl

Issue to convert the ssl certificates from pfx to peem with openssl


when i try to convert the .pfx certifates to .pem to import to ACM, i get this error

Error outputting keys and certificates 8C2B0000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:crypto\evp\evp_fetch.c:346:Global default library context, Algorithm (RC2-40-CBC : 0), Properties ()

the command i run

openssl pkcs12 -in filename.pfx -out filename.pem


Solution

  • If the command used to work in previous OpenSSL versions, try the following:

    Ensure you have the legacy library (file named legacy*.<os_lib_ext>, e.g. legacy-x64.dll). Instead of configuring environment variables it may be easier to just copy the library as legacy.<os_lib_ext> (e.g. legacy.dll) in both the libraries path and the path containing openssl executable.

    Then add -legacy -provider-path "/path/to/legacy_library/dir" -provider default:

    openssl pkcs12 -in filename.pfx -out filename.pem -legacy -provider-path "/path/to/legacy_library/dir" -provider default