简体   繁体   中英

PHP get_headers and curl both give empty result

I know there is some similar topic, but not the same. I have a working code, tested with a lot of different url - http and https as well - without any problem. Then, I found a website ... when I asking the URL header, I got empty array answer.

get_headers("https://www.diversalertnetwork.org/diving-incidents/Divers-air-consumption-appeared-unbelievably-good", 1);

And the result is an EMPTY array.

Array
(
)

I am also try with CURL but same result. I try to download the url's content but nothing. You can try it. Surprise! If I modify to http:// from https://, it will start working. Of course, the https link working very well in a browser. Also, the get_headers working with other https:// links. With curl I using my own browser's useragent, so that is a real if the server try to detect for any security reason. I really do not know what can I do, and most important, what happening, why there is no any answer, not an error or whatever.

php 5.6

My browser shows warning about that site's HTTPS connection:

The connection to this site uses an obsolete protocol (TLS 1.0), an obsolete key exchange (RSA), and an obsolete cipher (3DES_EDE_CBC with HMAC-SHA1).

So it might simply be that on your system making HTTPS connections with sites that only support outdated security protocols is disabled.


Which Apache config settings regarding SSL are relevant, can be found here: https://superuser.com/a/882651

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM