Monday, 30 September 2013

How to specify the SSL port with command line curl?

How to specify the SSL port with command line curl?

I'm trying to test the SSL connexion on one of my servers. The server is
behind a LB so it's listening for SSL connexions on the port 8090.
I have use the --resolve option to test when talking to the LB which
listens on port 443.
curl --resolve 'myservice.com:443:1.1.1.1' 'https://myservice.com'
but when I do:
curl --resolve 'myservice.com:8090:2.2.2.2' 'https://myservice.com:8090'
curl simply ignores the port and goes with 443. Of-course, this causes the
DNS cache to miss and I end-up using the public DNS IP...
* Added myservice.com:8090:2.2.2.2 to DNS cache
* About to connect() to myservice.com port 443 (#0)
* Trying 3.3.3.3...
* Connected to myservice.com (3.3.3.3) port 443 (#0)
How can I force curl to use the port 8090 for an SSL connexion?
Thanks.

No comments:

Post a Comment