最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

tcp - EIdOSSLUnderlyingCryptoError with message 'Error accepting connection with SSL. error:1408F10B:SSL routines:SSL3_G

programmeradmin3浏览0评论

I am trying to make a communication with a TCP socket (client/server) using Delphi 12 and Indy 10.6.2.0. I am getting the following error:

EIdOSSLUnderlyingCryptoError with message 'Error accepting connection with SSL. error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number'.

This is my server configuration (.dfm):

object IdTCPServer: TIdTCPServer
  OnStatus = IdTCPServerStatus
  Bindings = <>
  DefaultPort = 0
  IOHandler = sSSLHandler
  ListenQueue = 128
  OnConnect = IdTCPServerConnect
  OnException = IdTCPServerException
  OnListenException = IdTCPServerListenException
  TerminateWaitTime = 50000
  OnExecute = IdTCPServerExecute
  Left = 232
  Top = 204
end
object sSSLHandler: TIdServerIOHandlerSSLOpenSSL
  SSLOptions.CertFile = 'file.pem'
  SSLOptions.KeyFile = 'file.key'
  SSLOptions.Method = sslvTLSv1_2
  SSLOptions.SSLVersions = [sslvTLSv1_2]
  SSLOptions.Mode = sslmUnassigned
  SSLOptions.VerifyMode = []
  SSLOptions.VerifyDepth = 0
  Left = 640
  Top = 192
end

In the source (.pas):

if (AContext.Connection.IOHandler is TIdSSLIOHandlerSocketBase) then
  TIdSSLIOHandlerSocketBase(AContext.Connection.IOHandler).PassThrough:= false;

Client config (.dfm):

object IdTCPClient: TIdTCPClient
  IOHandler = sSSLHandler
  ConnectTimeout = 0
  Port = 0
  ReadTimeout = -1
  Left = 584
  Top = 312
end
object sSSLHandler: TIdSSLIOHandlerSocketOpenSSL
  MaxLineAction = maException
  Port = 0
  DefaultPort = 0
  SSLOptions.Method = sslvTLSv1_2
  SSLOptions.SSLVersions = [sslvTLSv1_2]
  SSLOptions.Mode = sslmClient
  SSLOptions.VerifyMode = []
  SSLOptions.VerifyDepth = 0
  Left = 296
  Top = 299
end

I've already checked the code from one end to the other and there's nothing that says ssl3. The error occurs when the client tries to establish communication with the server, although the exception occurs on the server side.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论