The Contrast Java Agent fails to connect to the Contrast Server and the following cause is seen in the agent log:
java.net.ConnectException: Connection refused (Connection refused)
The most likely cause of this error is that a firewall rule is blocking connectivity to the Contrast UI Server. However another possibility is that in a containerized environment, when the JVM (and therefore the Java Agent) starts up, the networking components of the environment are not yet fully provisioned when the agent attempts to connect to the Contrast Server.
Verify that a firewall rule is not in place blocking outbound traffic by attempting to reach the server from within the machine or container, for example using
curl -vL https://app.contrastsecurity.com/Contrast
openssl s_client -connect app.contrastsecurity.com:443 -debug
If connectivity succeeds, and this is a containerized environment check if ISTIO is being utilized.