How to get client IP address in OnClientError Event?

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
tcaduto12068
Posts: 132
Joined: Wed 17 Aug 2016 05:57

How to get client IP address in OnClientError Event?

Post by tcaduto12068 » Wed 26 Sep 2018 13:46

Hi,
I am using Lazarus and itn the OnclientError Event I have this:

Code: Select all

 if ClientInfo <> nil then
         begin
              ip:=inet_ntoa(clientinfo.SockAddr^.sin_addr);
              port:=intTostr(ntohs(ClientInfo.SockAddr^.sin_port));  

The client IP always comes back as 0.0.0.0

I get the port but not the IP.

The info in the log shows up like this:

SSH Client(0.0.0.0:59654) ERROR for user:N/A:Authentication failed

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: How to get client IP address in OnClientError Event?

Post by ViktorV » Wed 26 Sep 2018 14:21

The similar question has already been discussed on our forum. Follow the link viewtopic.php?f=27&t=36424 for details.
The TScSSHServer.BeforeClientConnect event is added in 8.2.4 from 24-Apr-18
If any specific questions remain or come up after reading the article, please contact us - we will answer you.

Post Reply