Tunneling socket could not be established, statusCode=407 with postman/newman

I am trying to run postman/newman docker container in one of my CI pipeline’s shell script-task so that I can send request to a destination.server. I am using a proxy with authentication. I have set proxy in shell environment variable as below:

export HTTPS_PROXY=http://user:password@server:port


docker run --env HTTPS_PROXY=${HTTPS_PROXY} -v dic:/etc/newman postman/newman run CollectionFile.json

When I run the pipeline i get the following error:

tunneling socket could not be established, statusCode=407

Can anyone give me some idea, am I missing anything while calling container? Or its not possible to user proxy (with authentication) with postman/newman container. Or the configuration is correct but something has to be done in proxy server.

It would be great if I get any suggestion, comments or feedback :slightly_smiling_face:.

Are you sure that server/port is accessible from the container?

Is there a way to disable auth on the proxy, to make sure the 407 is indeed coming from the proxy itself?

1 Like

Hi @zakarria.circle,

Welcome to the community! :clap:

As noted by @vdespa, can you validate that the container has access to the proxy? An easy way of doing this would be to log into the container, using the appropriate docker commands, and then from within the docker container, trying pinging, the proxy host, or performing an authentication within the container? If so, that should tell you enough if you’re able to authenticate from within the proxy.

If not, then you’ll need to edit your docker file to open up the proper ports in order to access that proxy server.

I dont know the exact commands off the top of my head, but this is something you should easily find by googling “log into docker container from terminal” and or “test outbound connections / proxy from within docker container”

Hope this helps!