We run a curl command regularly, and suddenly last night it started giving us errors. The error is this:

curl: (35) gnutls_handshake() failed: Error in the pull function.

Our server is Ubuntu 16.04.3 with all the upgrades and a fresh reboot.

The URL we are trying to request is HTTPS. It works if we request it from Chrome, but not from curl.

Any ideas? Thanks.


This problem may have to do with the fact our Linux was running as a virtual server. But this is how we fixed the problem:

We were requesting URL using the IP address of the server, and then adding a header with the Host: and domain name. Instead of using the IP address, we just used the domain name. That solved it.

  • 1
    You need to use the hostname for the SNI protocol to work and let the server find out which website you like. The Host header in HTTP is already too late as inside the TLS stream where the server may need to know which website you want to give back the appropriate certificate to establish the TLS stream. – Patrick Mevzek Jan 20 '18 at 0:22
  • Hi Petrick, How can I still force it if I want to keep debugging? – confiq Jul 23 '18 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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