Issue
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)
Cause
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.
Resolution
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
:
curl -vL https://app.contrastsecurity.com/Contrast
or openssl
:
openssl s_client -connect app.contrastsecurity.com:443 -debug
If connectivity succeeds, and this is a containerized environment check if ISTIO is being utilized.
Problem resolving features when using ISTIO in Kubernetes
See also: