title: Delphi Intraweb ISAPI DLL failed to connect with server using TLS/SSL
body: <p>I have a Delphi Intraweb application which is hosted on IIS using ISAPI DLL. This application internally connect with a Windows service application through <code>IndyClient</code>. Windows Service acts as an application server and written in Delphi itself.</p>
  <p>I want to secure the communication performed between <code>IndyClient</code> and <code>IndyServer</code> (at Windows service side) through TLS/SSL. For this I am using <code>TIdSSLIOHandlerSocketOpenSSL</code> at client side and <code>TIdServerIOHandlerSSLOpenSSL</code> at service side. below code has been written in service side -</p>
  <pre><code>IdServerIOHandlerSSLOpenSSL1.SSLOptions.CertFile := Config.ServerCertificate; 
  IdServerIOHandlerSSLOpenSSL1.SSLOptions.KeyFile := Config.ServerKey;
  
  IdServerIOHandlerSSLOpenSSL1.SSLOptions.Mode := sslmServer;
  IdServerIOHandlerSSLOpenSSL1.SSLOptions.VerifyMode := [];
  IdServerIOHandlerSSLOpenSSL1.SSLOptions.VerifyDepth  := 0;
  IdServerIOHandlerSSLOpenSSL1.SSLOptions.SSLVersions := [sslvTLSv1_2];
  
  IndyServer.IOHandler := IdServerIOHandlerSSLOpenSSL1;
  IndyServer.OnConnect := ServerConnect;
  
  // Config object gets the correct path for certificate and key file
  
  // Code for ServerConnect event 
  if (AContext.Connection.IOHandler is TIdSSLIOHandlerSocketBase) then
     TIdSSLIOHandlerSocketBase(AContext.Connection.IOHandler).PassThrough := False;
  </code></pre>
  <p>Below code is written inside ISAPI DLL to connect with <code>IndyServer</code></p>
  <pre><code>  IdSSLIOHandler.SSLOptions.VerifyMode := [];
    IdSSLIOHandler.SSLOptions.VerifyDepth := 0;
    IdSSLIOHandler.SSLOptions.SSLVersions := [sslvTLSv1_2];
    IdSSLIOHandler.SSLOptions.Mode := sslmClient;
    IndyClient.IOHandler := IdSSLIOHandler;
    TIdSSLIOHandlerSocketBase(IndyClient.IOHandler).PassThrough := False;
  </code></pre>
  <p>When I host the ISAPI DLL on IIS and try to connect with the Windows Service , getting below error message in Windows service side code -</p>
  <pre><code>EIdOSSLAcceptError with message 'Error accepting connection with SSL.EOF was observed that violates the protocol'
  </code></pre>
  <p>I have one desktop client application which connects with the same Windows service successfully using the same code written at client side.</p>
  <p>I am using Self Signed certificates and tried configuring IIS to use HTTPS as well. My Delphi version is <code>Delphi 10.2 Tokyo</code>.</p>