0

I've found an Indy example:

Id_HandlerSocket := TIdSSLIOHandlerSocketOpenSSL.Create( IdHTTP1 );
cert := 'zugang.pem';
Id_HandlerSocket.SSLOptions.CertFile := cert; (* PEM contain both CERT and Key *)
Id_HandlerSocket.SSLOptions.KeyFile := cert;
Id_HandlerSocket.SSLOptions.Mode := sslmClient;
Id_HandlerSocket.SSLOptions.Method := sslvSSLv23;
IdHTTP1.IOHandler := Id_HandlerSocket;

How can I provide the container password? Or, are there better Delphi tools to perform an SSL connection with client certificate?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770

1 Answers1

0

TIdSSLIOHandlerSocketOpenSSL has OnGetPassword and OnGetPasswordEx events, which you can use to supply the password for protected certificates, such as by prompting the user.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • It seems that unzipping the PKSC#12-Container does not work this way. Extracting Cert- and Key-File externally and providing the SSLIOHandler with the unzipped-keys works fine! But HOW can I unzip such a Container with Delphi. – DrKlobner Nov 28 '18 at 09:56
  • Great that works fine. I had not found it, becourse it is a property of SSLOptions. I am still getting only empty response, but it connects perfectly with SSL. I think this is due to wrong parameters. Thank you very much for you help. – DrKlobner Nov 29 '18 at 20:21
  • @DrKlobner `OnGetPassword` and `OnGetPasswordEx` are events of `TIdSSLIOHandlerSocketOpenSSL` itself, they are not members of its `SSLOptions` property. There is nothing in the `SSLOptions` that deals with passwords. – Remy Lebeau Nov 29 '18 at 20:25