razzmatazz 0 Posted June 27, 2023 Hi, I'm new to ICS. I need to load PKCS#12 certificate files in an application I'm developing in Delphi 7. I've been testing the PEM tool demo included in ICS (ICS/samples/delphi/SSLinternet/OberbyteICSPEMTool.dpr) with all my personal certs and it can open them all. All of them are PFX / P12. However, when I try to open some of them with my own code, it fails with the error of the subject: "Error PKCS12 certificate - error:0308010C:digital envelope routines::unsupported". cert := TX509Base.Create(nil); cert.LoadFromFile('cert.p12',croTry,croTry,'password'); cert.Free; The result is the same if I call LoadFromFileEx or LoadFromP12File directly, or if I try croNo or croYes instead of croTry. Both, the ICS sample/demo and my three lines of code are loading LIBSSL-3.DLL and LIBCRYPTO-3.DLL. Still, the demo works and my code doesn't. Any help would be much appreciated! Share this post Link to post
Angus Robertson 574 Posted June 27, 2023 You need to set GSSLEAY_LOAD_LEGACY := True in formcreate so OpenSSL loads the legacy provider that has obsolete cryptography that old versions of Windows still require. Making those PKCS12 functions backward and forward compatible was a nightmare. Angus 1 Share this post Link to post