I'm using a TIdHTTPServer component, so far is working fine, but when I added SSL support using this code
SSLHandler:= TIdServerIOHandlerSSLOpenSSL.Create(nil);
SSLHandler.SSLOptions.CertFile := 'foo.pem';
SSLHandler.SSLOptions.KeyFile := 'foo.pem';
SSLHandler.SSLOptions.RootCertFile := 'foo.pem';
SSLHandler.SSLOptions.Method := sslvSSLv23;
SSLHandler.SSLOptions.Mode := sslmServer;
SSLHandler.SSLOptions.VerifyDepth := 1;
SSLHandler.SSLOptions.VerifyMode := [sslvrfPeer,sslvrfFailIfNoPeerCert,sslvrfClientOnce];
idHttpServer1.IOHandler := SSLHandler;
IdHTTPServer1.Bindings.Add.Port := 80;
IdHTTPServer1.Bindings.Add.Port := 443;
IdHTTPServer1.Active := True;
The server only process https requests and if I send a http request this exception is thrown
Error accepting connection with SSL. error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request
The question is : I can use a single TIdHTTPServer component to process the http and https requests? if the answer is Yes how this can be done? If the answer is No, I must create two TIdHTTPServer instances one for http and another for https?