Skip to content

Instantly share code, notes, and snippets.

@KimSeongJun
Last active March 24, 2020 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KimSeongJun/24d739291103f1682b830229208f848c to your computer and use it in GitHub Desktop.
Save KimSeongJun/24d739291103f1682b830229208f848c to your computer and use it in GitHub Desktop.
Linkhub Root-CA test
<?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);
?>
<?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