Indy 10 How to get IP Address of SSL Client? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- JimD · 2019-05-11 19:45 I built a sweet little https remote file access for my home server. It all works fine, but I get some random attempts to connect from the Internet. How can I get the IP address of a connection attempt that results in a SSL error? I'm looking for the IP address at the time of SSL handshake. Using: Indy10.6.2.5494 OpenSSL-1.0.2l-i386-win32 TIdHTTPServer   ServerException:   "'Error accepting connection with SSL..." TIdServerIOHandlerSSLOpenSSL OnStatusInfo:   SSL status: "before/accept initialization"   SSL status: "SSLv3 read client hello A"   (how can I get the IP address of the client during this handshake?) ---------------------------------------------------------------------- Remy Lebeau · 2019-05-11 20:49 Quote from: jasc2v8 on May 11, 2019, 09:45:37 pmTIdServerIOHandlerSSLOpenSSL OnStatusInfo:   SSL status: "before/accept initialization"   SSL status: "SSLv3 read client hello A"   (how can I get the IP address of the client during this handshake?) The OnStatusInfo event does not provide any access to either the OpenSSL object that is performing the handshake, or the TCP socket that is associated with the OpenSSL object. The OnStatusInfoEx event, on the other hand, provides access to the OpenSSL PSSL object pointer, from which you can retrieve the TCP socket using OpenSSL's ssl_get_fd() function, and then you can pass that socket to your platform's getpeername() socket API function to get the client's IP. Alternatively, you can use the TIdContext.Binding.PeerIP property in any of the TIdHTTPServer events that provide a TIdContext object, such as in the OnException event. ---------------------------------------------------------------------- JimD · 2019-05-12 13:23 Thanks again, Remy! TIdContext.Binding.PeerIP worked for my needs.