Re: TIdHttpServer call from TIdHttp SSL

Giganews Newsgroups
Subject: Re: TIdHttpServer call from TIdHttp SSL
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Tue, 1 Jan 2008

"James" <…> wrote in message…

> error := IdSslConnect(fSSL);

That is directly calling OpenSSL's SSL_connect() function, so if there is
any hangup at that stage then it is inside OpenSSL itself, not in Indy.

> The server thread waits forever on on a line 1084 in IdIOHandler in

Your client is waiting for the server's SSL handshake, which never occurs.
So the client never sends anything to the server, so it waits for data that
never arrives.

> Note that the http server is non-SSL, but the client
> is trying to connect via SSL.

For that to happen, your client would have to be attempting to access an
HTTPS URL.  By default, TIdHTTPServer listens on port 80 only.  You should
not be accepting encrypted connections on port 80.  That port is meant for
unencrypted connections.

What you should do is add a second Binding to the server, and remove any
assignment to the server's IOHandler property.  Set the first Binding to
port 80, and the second Binding to port 8080.  In the server's OnConnect
event handler, explicitally assign a TIdSSLIOHandlerOpenSSL object to any
connection that is accepted on port 8080.



In response to

TIdHttpServer call from TIdHttp SSL posted by James on Mon, 31 Dec 2007