Last active
March 24, 2020 02:13
-
-
Save KimSeongJun/24d739291103f1682b830229208f848c to your computer and use it in GitHub Desktop.
Linkhub Root-CA test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$header = array(); | |
$header[] = 'Connection: close'; | |
$params = array('http' => array( | |
'ignore_errors' => TRUE, | |
'protocol_version' => '1.0', | |
'method' => 'GET' | |
)); | |
if ($header !== null) { | |
$head = ""; | |
foreach($header as $h) { | |
$head = $head . $h . "\r\n"; | |
} | |
$params['http']['header'] = substr($head,0,-2); | |
} | |
$ctx = stream_context_create($params); | |
$response = (file_get_contents('https://ca-test.linkhub.co.kr/', false, $ctx)); | |
if ($http_response_header[0] != "HTTP/1.1 200 OK") { | |
var_dump($response); | |
} | |
var_dump($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$http = curl_init('https://ca-test.linkhub.co.kr/'); | |
curl_setopt($http, CURLOPT_RETURNTRANSFER, TRUE); | |
$responseJson = curl_exec($http); | |
$http_status = curl_getinfo($http, CURLINFO_HTTP_CODE); | |
if ($responseJson != true){ | |
var_dump(curl_error($http)); | |
} | |
curl_close($http); | |
if($http_status != 200) { | |
var_dump($responseJson); | |
} | |
var_dump($responseJson); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment