English 中文(简体)
如何要求国家安全局与TIdHTTP无保障?
原标题:How to request insecure SSL with TIdHTTP?

I need to use TIdHTTP to request an HTTPS URL for an IP address on an SSL connection, so certificate validation will fail (if the peer even has a cert).

曲线有<条码>-无保障参数,仅作罚款,但我无法在<条码>中找到任何东西。 TIdHTTP,以完成同样的工作。

SSESocket := TIdHTTP.Create;
SSESocket.Request.Accept :=  text/event-stream ;
SSESocket.Request.CacheControl :=  no-store ;
SSESocket.Get( https:// +Host+ /eventstream/clip/v2 , SSEventStream);

我失踪了什么?

问题回答

您可明确指定以下部分:TIdSSLIOHandlerSocketOpenSSL part to the TIdHTTP.IOHandler property,然后由您将IOHandler s代码 property to [ ] and its SSLOptions.Verizeh property to 0.

SSESocket := TIdHTTP.Create;

// add this ...
SSEIO := TIdSSLIOHandlerSocketOpenSSL.Create(SSESocket);
SSEIO.SSLOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2];
SSEIO.SSLOptions.Mode := sslmClient;
SSEIO.SSLOptions.VerifyMode := [];
SSEIO.SSLOptions.VerifyDepth := 0;
SSESocket.IOHandler := SSEIO;
//

SSESocket.Request.Accept :=  text/event-stream ;
SSESocket.Request.CacheControl :=  no-store ;
SSESocket.Get( https:// +Host+ /eventstream/clip/v2 ,SSEventStream);

举例来说,TIdHTTP暗含地在您的缺席情况下形成内部TIdSSLIOHandlerSocketOpenSSL

您也可以选择指派一名手稿参加<>TIdSSLIOHandlerSocketOpenSSL.OnVerificationPeer的活动,并交还True,以接受服务器证书,而不论开放式特别服务公司是否通常予以拒绝。





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签