Synapse Delphi HTTPS SSL GET请求 [英] Synapse Delphi HTTPS SSL GET Request
本文介绍了Synapse Delphi HTTPS SSL GET请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
只有对HTTP网址的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.
推荐答案
确保:
- 您的exe应用程序可以访问
ssleay32.dll
和libeay32.dll
- 最简单的方法是将其复制到您的exe目录中。 - 你向您的项目添加了
ssl_openssl.pas
和ssl_openssl_lib.pas
。
- your exe application can access
ssleay32.dll
andlibeay32.dll
- the easiest way is to copy them into the directory of your exe. - you added
ssl_openssl.pas
andssl_openssl_lib.pas
to your project.
然后它应该立即工作。
这篇关于Synapse Delphi HTTPS SSL GET请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文