0

So I have the address for a couple of sites like so www.google.com and nothing more, no protocol. Is it possible to know which protocol does the website use using any networking tools such as curl or wget or anything. I just need to know whether it uses http or https

1
  • maybe simply try to connect via http and then via https - e.g. a simple curl GET or OPTIONS should do it - then check the result - if you don't end up with connection error or timeout it probably means that protocol is used. Note they are not exclusive, depends on how the server is set up. Note also that protocols can be assigned to different ports than standard 80, respectively 443 Commented May 15, 2017 at 12:39

2 Answers 2

2

You can achieve this with the following command:

openssl s_client -showcerts -connect google.com:443

This assumes that the server you are testing is setup to use the standard https port 443.

0

www.google.com works both with http and https.

You can find out if site works with https by using rules from popular extension "HTTPS everywhere" https://www.eff.org/https-everywhere/atlas/ (github source: https://github.com/EFForg/https-everywhere/tree/master/src/chrome/content/rules). Using openssl s_client (see answer Tokozo Zane) can help too. Or you can send HEAD request and look at the location header: curl -I -X HEAD http://ya.ru

Not the answer you're looking for? Browse other questions tagged or ask your own question.