Permalink
Browse files

allow custom CA certs to be used to verify hosts

partially fixes #38
  • Loading branch information...
1 parent 76d048f commit 3285ae0fa1af287dbee8b786d46bca44abbcd292 @willnorris willnorris committed Jan 2, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 Auth/Yadis/ParanoidHTTPFetcher.php
@@ -134,6 +134,9 @@ function get($url, $extra_headers = null)
if (Auth_OpenID_VERIFY_HOST) {
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
+ if (defined('Auth_OpenID_CAINFO')) {
+ curl_setopt($c, CURLOPT_CAINFO, Auth_OpenID_CAINFO);
+ }
} else {
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
}
@@ -215,6 +218,9 @@ function post($url, $body, $extra_headers = null)
if (Auth_OpenID_VERIFY_HOST) {
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
+ if (defined('Auth_OpenID_CAINFO')) {
+ curl_setopt($c, CURLOPT_CAINFO, Auth_OpenID_CAINFO);
+ }
} else {
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
}

0 comments on commit 3285ae0

Please sign in to comment.