Robe79
Robe79

Reputation: 9

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

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.

Upvotes: 0

Views: 31

Answers (0)

Related Questions