3

I want to crawl some https pages with php curl. PHP throws the following error:

gnutls_handshake() failed: A TLS fatal alert has been received.

My php is self compiled with the following parameters: --with-curl --with-openssl. I've also set the curl parameters CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER to 0.

The phpinfo() method displays me in the curl section the SSL-Version: GnuTLS/2.12.20

Does anyone know what's the problem?

jww
  • 97,681
  • 90
  • 411
  • 885
David
  • 4,027
  • 10
  • 50
  • 102
  • We need more details about the server and the fatal alert. Do you have the URL and alert number? Can you try with `openssl s_client` and TLS 1.0 (as opposed to SSLv3)? Also, just [bike shedding](http://bikeshed.com/), but this is probably bad idea: `CURLOPT_SSL_VERIFYHOST` and `CURLOPT_SSL_VERIFYPEER` to `0`. It may work for a crawler with no real security or confidentiality requirements. But I would not make a habit of it :) – jww May 18 '15 at 22:48
  • 1
    I doubt that it uses OpenSSL library since the error message clearly says it comes from GnuTLS. So it looks like your are not using the PHP you compiled. Apart from that receiving an alert can just mean anything, i.e. more details are needed to track down the problem (like the URL you are trying to access). – Steffen Ullrich May 19 '15 at 04:34

0 Answers0