idHttp:网站为https时,错误500内部服务器 [英] idHttp : error 500 internal server when site is https

查看:562
本文介绍了idHttp:网站为https时,错误500内部服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事一个涉及登录和下载的项目,对于20多个站点,在某些情况下,这些站点非常相似,即使它们的结构相同
我最近遇到了一个问题,一些相同的结构化站点是http,一些是HttpsHttp是可以正常工作的,但是在第一个post处的Https却返回错误500 internal server当我尝试登录时,响应代码显示

I am working on a project involving login and download, for more than 20 site, in some cases, the sites are very alike, even their structure is the same
i have encountered a problem recently, some of the same structured sites are http and some are Https, the Http ones are ok and work fine but the Https ones at the very first post return an error 500 internal server when i try to login, the response code shows

for security reasons you can not access ...

我是否需要更改https网站的方法?我该如何解决?
我的代码:

do i need to change my approach with https sites ? how can i fix this ?
my code :

mIdHttp := TIdHttp.create(nil);
mIdHttp.AllowCookies := true;
mIdHttp.HandleRedirects := true;
mIdHttp.Request.Charset := 'utf-8';
requestList.add('the post info from http analyzer');
mIdHttp.post('site login url', requestList, responseCode); // error happens here

出于隐私原因,我无法共享任何网站的网址

我做了关于设置处理程序的建议

for privacy reasons i can not share the url for any of the sites
Edit :
i did what was suggested about setting handler

LHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
mIdHttp.IOHandler:=LHandler;  

但是没有用! (我还下载了两个dll)

but it didn't work! (i also downloaded the two dll)

新发展:
我只是注意到Windows Internet Explorer也无法打开该网站!!并返回错误:

New development :
i just noticed the windows internet explorer cant open the site either!! and it returns an error :

Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting to somesite.com  again. If this error persists, contact your site administrator.  

我认为该网站的证书是伪造的,如果我转到设置并取消选中

i think the certificate for the site is a fake, and if i go to the setting and uncheck the

check for publisher certifcate revocation  

Internet Explorer中的

选项,该站点打开!,这是我收到错误消息的原因吗? 我如何对idHttp做同样的事情?

option in internet explorer, the site opens!, is this the reason i'm getting an error ? how can i do the same to idHttp ?

编辑2(新网站):
因为该站点的问题与上一个站点非常相似,所以我决定不为此创建新问题

Edit 2 (A New Site):
because the problem with this site is very similar to the previous one, i decided not to create a new question for this

我在新站点上遇到错误500,当我尝试手动转到该站点并登录时,我在firefox中遇到了This Connection is Untrusted错误,在其他浏览器中也遇到了类似的错误,这是Firefox的图片错误:

I'm getting an error 500 with a new site , when i try to manually go to the site and login i get an This Connection is Untrusted error in firefox and similar error in other browsers here is a picture o the firefox error :

我已经尝试过

LHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
//LHandler.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
LHandler.OnVerifyPeer := OnVerifyPeer;
mIdHttp.IOHandler := LHandler;  

function OnVerifyPeer(certificate: TIdX509; AOk: Boolean; Adepth:Integer; AError: Integer): boolean;
begin
  Result := true;
end;

但我仍然遇到相同的错误
我还应该提到在这种特殊情况下,使用idHttp.Get 不会引起任何错误,当我尝试Post进行登录时会发生该错误.
还有一件事,我同时使用httpAnalyzerfiddler,但是当我运行程序时,它们都无法访问postsgets网站(仅 无效)当我使用我的程序并尝试针对该特定站点的postget时.)

but i still get the same error
i also should mention that in this particular case, using idHttp.Get does not cause any error, the error happens when i trying to Post for login.
one more thing, i use both httpAnalyzer and fiddler, but none of them can pick up the site posts or gets when i run my program (they only don't work when i use my program and i try to postand get for this particular site).

推荐答案

我只是注意到Windows Internet Explorer无法打开该站点!!并返回错误:

i just noticed the windows internet explorer cant open the site either!! and it returns an error :

在高级"设置中打开TLS 1.0,TLS 1.1和TLS 1.2,然后尝试再次连接到somesite.com.如果此错误仍然存​​在,请与您的站点管理员联系.

Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting to somesite.com again. If this error persists, contact your site administrator.

TIdSSLIOHandlerSocketOpenSSL.SSLOptions.SSLVersions属性中启用sslvTLSv1sslvTLSv1_1sslvTLSv1_2标志.

Enable the sslvTLSv1, sslvTLSv1_1, and sslvTLSv1_2 flags in the TIdSSLIOHandlerSocketOpenSSL.SSLOptions.SSLVersions property.

我认为该网站的证书是伪造的,如果我转到设置并取消选中

i think the certificate for the site is a fake, and if i go to the setting and uncheck the

检查发布者证书撤销

Internet Explorer中的选项,该站点将打开!

option in internet explorer, the site opens!

将处理程序分配给TIdSSLIOHandlerSocketOpenSSL.OnVerifyPeer事件,并使其对要接受的任何证书返回True.

Assign a handler to the TIdSSLIOHandlerSocketOpenSSL.OnVerifyPeer event and have it return True for any certificate you want to accept.

这篇关于idHttp:网站为https时,错误500内部服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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