Curl command cannot connect to target device from within HA

I a using command line to operate a device that supports CGI commands. The commands work from my computer, either as https links or curl commands from my laptop’s console, but when I try from HA console I get:

curl: (7) Failed to connect to ... port 443 after 1 ms: Couldn’t connect to server
[core-ssh ~]$

There might be some firewall rule issue on my unifi environment, but I don’t know much about rules to investigate. Using Net Analyzer from my phone for a port scan to the target device, shows the port open. Is there a way like a similar app to check the connectivity between HA and the target device?