Indy 10和sslvTLSv1

编程入门 行业动态 更新时间:2024-10-21 22:54:48
本文介绍了Indy 10和sslvTLSv1_2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个网站发布到该网站,目前支持TLS v1.1和TLS 1.2。他们很快将仅允许TLS ver 1.2连接。出于这个原因,我将Delphi 5升级到了Indy 10。

I have a website I post to that currently supports TLS v1.1 and TLS 1.2. They will soon only allow TLS ver 1.2 connections. I upgraded Delphi 5 to Indy 10 for this reason.

当前,我用代码创建了组件,并且每次运行3个线程都可以正常工作:

Currently, I create my components in code and everything works great running 3 threads at a time:

HTTp := TIdHttp.Create(nil); HTTP.OnSelectAuthorization := HTTPSelectAuthorization; HTTP.HTTPOptions := [hoInProcessAuth,hoForceEncodeParams,hoKeepOrigProtocol]; HTTP.OnStatus := HTTPStatus; HTTP.OnWorkEnd := HTTPWorkEnd; HTTP.Request.ContentType := 'application/x-www-form-urlencoded'; HTTP.ProxyParams.ProxyPort := ProxyPort; HTTP.ProxyParams.ProxyUsername := ProxyUserName; HTTP.ProxyParams.ProxyPassword := ProxyPassword; HTTP.ProxyParams.BasicAuthentication := ProxyBasicAuth; end; If UseSSL and (SSL = nil) then Begin SSL := TIDSSLIOHandlerSocketOpenSSL.Create(nil); SSL.SSLOptions.Mode := sslmClient; SSL.OnGetPassword := SSLGetPassword; SSL.SSLOptions.Method := sslvTLSv1_2; HTTP.IOHandler := SSL; end;

是否存在一个事件,我可以告诉我发送时当前实际连接的TLS版本一个帖子?当他们最终停止接受TLS v1.1连接时,我不希望感到惊讶。

Is there an event that I would tell me exactly what TLS version I am current actually connecting with when sending a post? I don't want there to be a surprise when they finally stop accepting TLS v1.1 connections.

谢谢。

推荐答案

没有专门为此目的的事件。您必须使用 OnStatus 事件中。 manmaster / ssl / SSL_get_version.html rel = nofollow> SSL_get_version() 函数。

There is no event specifically for that purpose. You would have to query the underlying SSL object directly, such as in the OnStatus event, using the SSL_get_version() function.

但是,您仅将 Method 设置为TLS 1.2,因此Indy将使用全部(只要您使用支持1.2的OpenSSL版本,否则Indy将使用悄无声息地回落到1.0)。

However, you are setting the Method to TLS 1.2 exclusively, so that is all Indy will use (as long as you use a version of OpenSSL that supports 1.2, otherwise Indy will silently fallback to 1.0).

另一方面,您的 UseSSL if块看起来应该更像这样:

On a side note, your UseSSL if block should look more like this:

If UseSSL then Begin If (SSL = nil) then Begin SSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); SSL.SSLOptions.Mode := sslmClient; SSL.OnGetPassword := SSLGetPassword; SSL.SSLOptions.Method := sslvTLSv1_2; End; HTTP.IOHandler := SSL; end;

更多推荐

Indy 10和sslvTLSv1

本文发布于:2023-06-08 21:27:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/589362.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Indy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!