PHP - Errors with get_headers and SSL
问题 This is my code $url = 'http://www.wikipedia.com'; // URL WITH HTTP $hurl = str_replace("http", "https", $url); // URL WITH HTTPS $urlheads = get_headers($url, 1); $surlheads = get_headers($hurl, 1); $urlx = false; $surlx = false; foreach ($urlheads as $name => $value) { if ($name === 'Location') { $urlx=$value; } else{ } } print_r($urlx); And this is error I'm getting: Warning: get_headers(): Peer certificate CN=`*.wikipedia.org' did not match expected CN=`www.wikipedia.com' in.... Warning: