Jump to content
razzmatazz

Error PKCS12 certificate - error:0308010C:digital envelope routines::unsupported

Recommended Posts

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

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

 

 

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×