使用 NTLM 身份验证和 Indy 组件连接到 Squid 服务器

发布于 2024-09-03 08:27:06 字数 259 浏览 10 评论 0原文

是否有人使用 Indy (10.XX) 组件通过使用 NTLM 身份验证的 Squid 代理服务器设置成功连接到 https 位置?

我可以成功连接到 http 位置,但是使用 https Indy 返回 EAbort 错误。

另外,如果我使用 FreeProxy 作为代理服务器(使用 NTLM 身份验证),我可以同样良好地访问 http/https。但是 Squid NTLM + https 不起作用?有人让这个工作吗?

谢谢 雷尔

Has anybody managed to successfully connect to a https location via Squid proxy server setup with NTLM authentication, using Indy (10.XX) components?

I can successfully connect to http locations, however with https Indy returns an EAbort error.

Also, I can access http/https equally well if I use FreeProxy as the proxy server (with NTLM authentication). However Squid NTLM + https does not work? Anybody got this to work?

Thanks
Rael

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难如初 2024-09-10 08:27:06

我在这里

1 - 首先,确保您已经更新了 indy 的源代码。

2 - 从此处下载 SSL dll Indy SLL DLL 并将它们放入您的应用程序输出中

3 - 确保您有一个连接到 TidHttp IOHandler 属性的 TIdSSLIOHandlerSocketOpenSSL,并配置了以下属性:

SSLOptions.Method := sslvSSLv23;
SSLOptions.Mode := sslmUnassigned;
OnVerifyPeer := SSLIOHandlerVerifyPeer;
SSLOptions.VerifyMode := [sslvrfPeer];
SSLOptions.VerifyDepth := 2;

4 - 写入此事件:

function SSLIOHandlerVerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError:    Integer): Boolean;
begin
  Result := True;
end;

5 - 将这些单元包含到您的use 子句:

IdAuthentication, IdAuthenticationDigest, IdAuthenticationNTLM

6 - 将 TidHttp.OnProxyAuthorization 事件设置为:

procedure IdHTTPProxyAuthorization(Sender: TObject; Authentication: TIdAuthentication; var Handled: Boolean);
begin
  Handled := False;
end;

7 - 设置这些属性:

IndyHttpClient.HTTPOptions := IndyHttpClient.HTTPOptions + [hoKeepOrigProtocol] + [hoInProcessAuth];
IndyHttpClient.ProtocolVersion := pv1_1;
IndyHttpClient.ProxyParams.ProxyServer := 'you proxy address here'
IndyHttpClient.ProxyParams.ProxyPort := 8080;
IndyHttpClient.ProxyParams.ProxyUsername := 'your proxy username here';
IndyHttpClient.ProxyParams.ProxyPassword := 'your proxy psw here';

现在您就可以开始了。此代码也适用于 Microsoft ISA Server。如果您愿意,我可以向您发送我的组件的完整源代码。我不会在这里发布它,因为它是用葡萄牙语写的(除非有人说可以发布)。

Here I am

1 - First of all, make sure you have updated indy's source.

2 - Download the SSL dlls from here Indy SLL DLLS and put them in your app output

3 - Make sure you have a TIdSSLIOHandlerSocketOpenSSL connected to the TidHttp IOHandler property with the follow properties configured:

SSLOptions.Method := sslvSSLv23;
SSLOptions.Mode := sslmUnassigned;
OnVerifyPeer := SSLIOHandlerVerifyPeer;
SSLOptions.VerifyMode := [sslvrfPeer];
SSLOptions.VerifyDepth := 2;

4 - Write this event:

function SSLIOHandlerVerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError:    Integer): Boolean;
begin
  Result := True;
end;

5 - Include these units to your uses clause:

IdAuthentication, IdAuthenticationDigest, IdAuthenticationNTLM

6 - Set the TidHttp.OnProxyAuthorizationevent to this:

procedure IdHTTPProxyAuthorization(Sender: TObject; Authentication: TIdAuthentication; var Handled: Boolean);
begin
  Handled := False;
end;

7 - Set those properties:

IndyHttpClient.HTTPOptions := IndyHttpClient.HTTPOptions + [hoKeepOrigProtocol] + [hoInProcessAuth];
IndyHttpClient.ProtocolVersion := pv1_1;
IndyHttpClient.ProxyParams.ProxyServer := 'you proxy address here'
IndyHttpClient.ProxyParams.ProxyPort := 8080;
IndyHttpClient.ProxyParams.ProxyUsername := 'your proxy username here';
IndyHttpClient.ProxyParams.ProxyPassword := 'your proxy psw here';

Now you are good to go. This code will also work with Microsoft ISA Server. If you want me to, i can send to you the full source code of my component. I will not post it here because it was written in portuguese (unless someone says its ok to post).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文