How to specify the SSL port with command line curl?

Tested with curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3, the --resolve header works as expected with https and a non-standard port specified in both places.


If --resolve is not working out, you can specify the Host header (you might need to supress certificate warnings with -k):

curl -k -H 'Host: myservice.com' 'https://2.2.2.2:8090'

or with more verbose terms:

curl --insecure --header 'Host: myservice.com' 'https://2.2.2.2:8090'