To interface with the bank, you need to use Delphi to post data, but the other side provides a URL beginning with HTTPS, need to use the certificate, the other party has provided the certificate, but still the call is unsuccessful, Using the Idhttp and Tidssliohandlersocketopenssl to post, the Indy version is 10.5.5, and the DLL version of OpenSSL is Openssl-1.0.0-i386-win32. The error now reported is: "Could not load certificate Error:0906d06c:pem routines:PEM_read_bio:no start line".
The other side provides several certificates, the suffix name is:. cer,.pem,.pfx, do not know which one to use, and the other side does not have the Delphi version of the demo, only Java and C #. On-line search for two days of information, no win, do not know how to start, in order to communicate successfully.
The altar that friend has this aspect of development experience, please hesitate to instruct twos, thank you!
Set the following two properties
Certificate file:
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.CertFile
Key file:
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.KeyFile
and return the key protection password in the Ongetpassword event.
Starting and ending lines for the PEM format certificate:
References
-----BEGIN CERTIFICATE-----
......
-----END CERTIFICATE-----
The starting and ending lines of the PEM-formatted private key:
Reference
-----BEGIN RSA PRIVATE KEY-----
......
-----END RSA PRIVATE KEY-----
A certificate in PFX format can also be converted to a valid PEM format using the OpenSSL.exe utility.
Reference
openssl.exe pkcs12-in certificate. Pfx-out certificate and key. PEM
--------------------------------------------------------------------------------
The garbled problem also solved
The key code is on these three lines.
Rsltstrm:=tstringstream.create (', Tencoding.utf8);
Idhttpclient.post (' Www.abcc.com/abc ', TMPSTRLIST,RSLTSTRM);
tmpstrlist.text:=rsltstrm.datastring;
Thank you all friends!!!
http://bbs.csdn.net/topics/350164870
Idhttp set the SSL certificate, garbled problem also solved