The issue was happening only in the environment with Selenium and Jenkins executing an automated script.
We were able to execute the commands below via Postman and Curl, and had no issues to get the valid responses:
curl -X POST http://UserName:[email protected]
To try to understand how the commands were getting in the Registry side, we used tcpdump in the Registry server and collected the network traffic while reproducing the issue. More information on how to capture network traffic with tcpdump in the link below:https://comm.support.ca.com/kb/how-to-capture-network-traffic-using-tcpdump/KB000094804
When analyzing the network traffic between the Jenkins side and Registry server on port 1505, we could find several HTTP traffic with 401 unauthorized.
When doing 'follow TCP stream' we saw it was a response to the command to deploy the MAR file and there was no authorization header.
When we got a valid response for this same command, the authorization header was available.
We asked the team to modify the script used to the deploy the MAR file and make sure the credentials are sent every time we execute the POST calls.
The script was modified to pass the credentials as part of HttpPost instead of HttpClient.
After this change, we stopped seeing the SocketTimeOutException.