Synapse Delphi HTTPS SSL GET 请求 [英] Synapse Delphi HTTPS SSL GET Request

查看:46
本文介绍了Synapse Delphi HTTPS SSL GET 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只有对 HTTP url 的 GET 请求有效.如果我尝试请求 HTTPS 网址,则它不会返回任何内容.我几乎尝试了一切.感谢您的帮助.

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.

这是我的代码:

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

SynHTTP 是一个 THTTPSend 对象.

SynHTTP is a THTTPSend object.

推荐答案

确保:

  1. 您的 exe 应用程序可以访问 ssleay32.dlllibeay32.dll - 最简单的方法是将它们复制到您的 exe 目录中.
  2. 您已将 ssl_openssl.passsl_openssl_lib.pas 添加到您的项目中.
  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.

这篇关于Synapse Delphi HTTPS SSL GET 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆