Synapse Delphi HTTPS SSL GET Request

拟墨画扇 提交于 2019-12-09 06:59:54

问题


Only a GET request to a HTTP url works. If i try to request a HTTPS url then it doesn't return anything. I pretty much tried everything. Appreciate any help.

Here's my code:

 SynHttp.Sock.CreateWithSSL(TSSLOpenSSL);
 SynHttp.Sock.SSLDoConnect;
 SynHttp.HTTPMethod('GET', 'https://www.google.com/');
 Resp.LoadFromStream(SynHttp.Document);
 HtmlResponse := Resp.Text;

SynHTTP is a THTTPSend object.


回答1:


Make sure:

  1. your exe application can access ssleay32.dll and libeay32.dll - the easiest way is to copy them into the directory of your exe.
  2. you added ssl_openssl.pas and ssl_openssl_lib.pas to your project.

Then it should work instantly.



来源:https://stackoverflow.com/questions/11377320/synapse-delphi-https-ssl-get-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!