ãããªæãããªã
<?php $url = $argv[1]; $req = new HTTP_Request2( $url, HTTP_Request2::METHOD_GET ); $req->setConfig( array( 'ssl_cafile' => '/etc/pki/tls/certs/ca-bundle.crt', ) ); try { $res = $req->send(); $body = $res->getBody(); echo $body; } catch (HTTP_Request2_Exception $e) { die('Error: ' . $e->getMessage() . "\n"); } ?>
ããã©ã«ãã§è¨¼ææ¸ã®æ¤è¨¼ã®ãªãã·ã§ã³(ssl_verify_peer)ãæå¹ã«ãªã£ã¦ããã®ã§ssl_cafileãè¨å®ããªãã¨ã¨ã©ã¼ã«ãªã£ã¦ãã¾ããCentOS6ä¸ã ã£ãã®ã§ca-certificatesããã±ã¼ã¸ã®è¨¼ææ¸ãå©ç¨ãã¦ããã
ssl_verify_peerãfalseã«ããã¨ããæããããã»ãã¥ãªãã£ä¸ãããããªãã
ããããssl_cafileãæå®ããªãã£ãæã®ã¨ã©ã¼æ å ±å°ãªãã
Error: Unable to connect to ssl://twitter.com:443. Error #0: