After compiling my win32 client/server application (using INDY and TMS Sparkle) with Delphi 10.4 I get an ssl error. I use Indy with and a self signed certificate on the server side and indy on the client side. The error message is (translated from german):
Error connection with SSL. EOF encountered violating the protocol.
I did not change any code or environment from 10.3 where it ran perfectly. I can break it down to the server side as the old server (compiled in 10.3) runs with the new client (compiled with 10.4) but the old client also breaks when trying to connect to the new server.
This is how I initialize SSL:
SecureServer := TIndySparkleHTTPServer.create(nil);
SecureServer.DefaultPort := SecurePort;
// Initialize SSL with self signed certificate
SSLHandler := TIdServerIOHandlerSSLOpenSSL.create(SecureServer);
SSLHandler.SSLOptions.CertFile := SharedVals.ServerPath + 'appcert.pem';
SSLHandler.SSLOptions.RootCertFile := SharedVals.ServerPath + 'approot.pem';
SSLHandler.SSLOptions.KeyFile := SharedVals.ServerPath + 'appkey.pem';
SSLHandler.SSLOptions.Method := sslvSSLv23;
SecureServer.IOHandler := SSLHandler;
Emba managed to break Indy in 10.3, perhaps this is an other case like this?
EOF encountered violating the protocol
means the server closes the TCP connection in the middle of an SSL/TLS handshake. Typically that can happen if the server doesn't like something in the handshake, but OpenSSL will usually send an alert to the client before closing the connection. Did you check if your server is raising an uncaught exception after the client connects? On a side note, you really should not be using theSSLOptions.Method
property at all, use theSSLOptions.SSLVersions
property instead, egSSLHandler.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
– Remy LebeauTIdHTTPServer
or its use of OpenSSL in the latest Indy. – Remy LebeauEIdHTTPErrorParsingCommand
is raised whenTIdHTTPServer
receives a malformed HTTP request. SinceTIdHTTPServer
does not process decrypted HTTPS requests until after an SSL/TLS handshake has been completed first, that implies that your server is not actually trying to perform an SSL/TLS handshake at all and thus is trying to parse the client's SSL/TLS handshake request as if it were an HTTP request. Is yourSecurePort
set to a non-standard HTTPS port (something other than 443)? If so, make sure your server has anOnQuerySSLPort
event handler that returnsVUseSSL=True
for that port – Remy Lebeau