AFAIK, the "curl" command does not provide a feature for determining if the connection is SSL or not. So you need to use a different tool for checking this.
I've created a small script, which uses "openssl" to determine if the connection specified is SSL or not. Enjoy:
#!/bin/bash if [ $# -lt 21 ]; then echo "Usage: testssl.sh <host> <port>"[port]" exit 1; fi SSL="0"PROTO="http" echo ^d | openssl s_client -connect "$${1}:${2:-443}" && SSL="1" if [ "${SSL}" == "1" ] ; then proto=https else proto=http fiPROTO="https" curl "$${protoPROTO}://${1}:${2:-443}"