Skip to main content

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}" 

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 2 ]; then echo "Usage: testssl.sh <host> <port>" exit 1; fi SSL="0" echo ^d | openssl s_client -connect "${1}:${2:-443}" && SSL="1" if [ "${SSL}" == "1" ] ; then proto=https else proto=http fi curl "${proto}://${1}:${2}" 

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 1 ]; then echo "Usage: testssl.sh <host> [port]" exit 1; fi PROTO="http" echo ^d | openssl s_client -connect ${1}:${2:-443} && PROTO="https" curl ${PROTO}://${1}:${2:-443} 
imported default-port 443 and added quotes
Source Link
Jeff Schaller
  • 68.9k
  • 35
  • 122
  • 268

AFAIK, the "curl" command does not provide a feature for determining if the connection is sslSSL 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 sslSSL or not. Enjoy:

#!/bin/bash if [ $# -lt 2 ]; then echo "Usage: testssl.sh <host> <port>" exit 1; fi SSL="0" echo ^d | openssl s_client -connect $"${1}:${2:-443}" && SSL="1" if [ "${SSL}" == "1" ] ; then proto=https else proto=http fi  curl $"${proto}://${1}:${2}" 

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 2 ]; then echo "Usage: testssl.sh <host> <port>" exit 1; fi SSL="0" echo ^d | openssl s_client -connect ${1}:${2} && SSL="1" if [ "${SSL}" == "1" ] ; then proto=https else proto=http fi  curl ${proto}://${1}:${2} 

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 2 ]; then echo "Usage: testssl.sh <host> <port>" exit 1; fi SSL="0" echo ^d | openssl s_client -connect "${1}:${2:-443}" && SSL="1" if [ "${SSL}" == "1" ] ; then proto=https else proto=http fi curl "${proto}://${1}:${2}" 
Source Link
gerhard d.
  • 2.3k
  • 15
  • 23

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 2 ]; then echo "Usage: testssl.sh <host> <port>" exit 1; fi SSL="0" echo ^d | openssl s_client -connect ${1}:${2} && SSL="1" if [ "${SSL}" == "1" ] ; then proto=https else proto=http fi curl ${proto}://${1}:${2}