【问题标题】:Delphi XE4 Pro THTTPRIO + https connectionDelphi XE4 Pro THTTPRIO + https 连接
【发布时间】:2014-02-13 18:04:06
【问题描述】:

我正在使用 Delphi XE4 Pro 我使用 webBroker 创建了一个服务器 DLL,并创建了导入服务器 WSDL 接口的客户端 DLL。 一切正常,但现在我想使用安全连接 https 进行连接。 在服务器上,我有一个由 godaddy 颁发的有效 *.domain SSL 证书。 只需将 RIO URL 更改为使用 https,所有客户端-服务器通信仍然有效。

我的问题是:您知道现在在 XE4 中 THTTPRIO 是否能够自动处理 https 连接,或者我需要(以某种方式)更改代码? 另外,您能否推荐一个好的工具来验证标头,以查看我是否使用了良好的 https 连接?

非常感谢..

function GetIHFSINET(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IHFSINET;
const
  defWSDL_server = 'https://etc';
  defURL_server  = 'https://etc';
  defSvc  = 'IHFSINETservice';
  defPrt  = 'IHFSINETPort';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
    Addr := defWSDL_server;  //there is actually a function that returns the correct URL to use
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as IHFSINET);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;

【问题讨论】:

标签: delphi ssl delphi-xe4


【解决方案1】:

将 URL 更改为 https 就是您需要做的所有事情 - 它会通过将端口更改为 443 等来处理其余的事情。

就验证消息而言,您可能需要查看 RIO.OnBeforeExecute 和 RIO.OnAfterExecute 事件。

【讨论】:

  • 什么是服务器证书验证?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-05-09
  • 2014-03-13
  • 2013-11-04
  • 2014-05-17
  • 1970-01-01
  • 2010-10-09
  • 1970-01-01
相关资源
最近更新 更多