PHP从URL获取数据

I'm having problems with fetching data from URL. When I input URL in browser file normally gets downloaded to my computer, but when I try to access it in my code I get response FALSE, with no errors just bool(false) response. It's function for ICAL sync and 3 or 4 urls are fine but that one is just not getting data. Tried both with file_get_contents and with CURL. Here is CURL function:

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    curl_close($ch);

Here are some info about server:

PHP Version = 5.6.10-pl0

allow_url_fopen = On

OpenSSL support = enabled

And yeah file is on HTTPS server if that's maybe an issue. Thank you guys in advance.

In this answer local refers to your server, remote to the other one (the one you are trying to access).

From the error message:

SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

it looks like your client and the server implementation cannot agree on a common cipher suite to use. This usually means one implementation is a bit dated.

There is no problem with the remote certificate. This would have yielded a different error message.

Check the remote server

You can use for example SSL Server Test to determine which Protocol versions and ciphers the remote server is using.

Then you can select some of them for curl to use (Source for code):

curl_setopt($curl, CURLOPT_SSL_CIPHER_LIST, 'ECDHE-RSA-AES128-GCM-SHA256,...');

Check the local/your server

You said you are using PHP 5.6.10. This is quite a bit out of date. (It was released on 11 Jun 2015). The current 5.6 version branch is at 5.6.34. If I was you I would consider an upgrade.

From the SSL Server test: The remote server only accepts TLS1.2. So you should also consider upgrading your OpenSSL installation.

Some more links for reference: