更新时间:2023-09-11 15:12:34
没有专门为此目的的事件。您必须使用 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;