Idhttp set the SSL certificate, garbled problem also solved

Source: Internet
Author: User
Tags begin rsa private key ssl certificate

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.