TIdhttp HTTPS握手失败

时间:2018-09-26 13:09:12

标签: delphi indy indy10

我正在使用Indy 10连接到SOAP Web服务。当我在Fiddler运行的情况下运行代码时,我发现Web服务器没有在协商我们的握手。我已经附上了Fiddler Inspectors的屏幕截图。

我们已经能够使用共享软件应用程序“ SoapUI”成功连接到服务器。使用SoapUI时,我已附加了检查员的屏幕快照。

我注意到的一件事是SoapUI正在使用不同版本的SSL / TLS。如何将Indy配置为使用相同版本?

关于我的通话失败的任何其他见解?

procedure TForm6.Button1Click(Sender: TObject);
var
  idhttp: TIdhttp;
  IdSSLIOHandlerSocket1 : TIdSSLIOHandlerSocketOpenSSL;
  Params   : TStringStream;
begin
    idhttp := TIdhttp.Create(nil);
    IdSSLIOHandlerSocket1 := TIdSSLIOHandlerSocketOpenSSL.create(nil);
    idhttp.ProxyParams.ProxyServer := '127.0.0.1';
    idhttp.ProxyParams.ProxyPort := 8888 ;
    idhttp.Request.ContentType := 'text/xml';
    idhttp.Request.CharSet:='utf-8';
    idhttp.request.connection := 'keep-alive';
    idhttp.Request.CustomHeaders.AddValue('Content-Type','text/xml;charset=UTF-8');
    idhttp.Request.CustomHeaders.AddValue('SOAPAction','"http://ws.nemsis.org/SubmitData"');
    idhttp.Request.CustomHeaders.AddValue('Host','nemsis.org:443');
    idhttp.Request.BasicAuthentication := True;
    idhttp.request.username := 'xxxxx';
    idhttp.request.password := 'yyyyy';
    with IdSSLIOHandlerSocket1 do begin
      SSLOptions.Method := sslvTLSv1_2;
      SSLOptions.SSLVersions := [sslvTLSv1_2];
      SSLOptions.VerifyMode := [];
      SSLOptions.VerifyDepth := 2;
    end;
    with IdHTTP do begin
      IOHandler := IdSSLIOHandlerSocket1;
    end;
    Params := TStringStream.Create(filetostring(ExtractFileDir(ParamStr(0))+'\sample.xml'));
    idhttp.Post('https://nemsis.org:443/NemsisV3Validator4/NemsisWsService',Params);
end;

呼叫失败: enter image description here

使用SoapUI成功调用: enter image description here

0 个答案:

没有答案
相关问题