Why can't gnutls
contact the site in question, even though wget gets the page just fine?
$ gnutls-cli https://site.com/login.php --insecure --print-cert < /dev/null > cert
WARNING: gnome-keyring:: couldn't connect to: /run/user/dotancohen/keyring-Ekufyf/pkcs11: No such file or directory
Cannot resolve https://site.com/login.php:443: Name or service not known
$ wget https://site.com/login.php
--2013-01-23 19:07:57-- https://site.com/login.php
Resolving site.com (site.com)... 72.1.2.3
Connecting to site.com (site.com)|72.1.2.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6581 (6.4K) [text/html]
Saving to: `login.php'
100%[=============================================>] 6,581 --.-K/s in 0s
2013-01-23 19:07:58 (47.8 MB/s) - `login.php' saved [6581/6581]
$
gnutl-cli -v
)? – goldilocks Jan 23 '13 at 17:46gnutls-cli
expects a hostname (with -p for the port), not a URL – Stéphane Chazelas Jan 23 '13 at 18:05gnutls-cli
is only a TLS (SSL) client – it doesn't care at all about higher-level protocols such as HTTP. 2) However, at TLS level, if you givegnutls-cli
a hostname, it sends that hostname to the server, the same way as browsers do – and that's sufficient for the server to pick the right certificate. – u1686_grawity Jan 23 '13 at 19:49