Skip to content
Browse files

Merge remote-tracking branch 'upstream/master'

Conflicts:
	docs/OpenIDProvider/setup.php
	tests/Auth/OpenID/StoreTest.php
  • Loading branch information...
2 parents 6dbac77 + d4e5efe commit 3b4dd3822c581f0175eed54cf354efcf0eb525fa @ijansch committed Mar 18, 2012
Showing with 31 additions and 9 deletions.
  1. +27 −5 Auth/Yadis/ParanoidHTTPFetcher.php
  2. +2 −2 docs/detect.php
  3. +1 −1 docs/discover.php
  4. +1 −1 tests/Auth/OpenID/StoreTest.php
View
32 Auth/Yadis/ParanoidHTTPFetcher.php
@@ -129,9 +129,19 @@ function get($url, $extra_headers = null)
curl_setopt($c, CURLOPT_URL, $url);
if (defined('Auth_OpenID_VERIFY_HOST')) {
- curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true);
- curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
+ // set SSL verification options only if Auth_OpenID_VERIFY_HOST
+ // is explicitly set, otherwise use system default.
+ 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);
+ }
}
+
curl_exec($c);
$code = curl_getinfo($c, CURLINFO_HTTP_CODE);
@@ -153,6 +163,7 @@ function get($url, $extra_headers = null)
curl_close($c);
if (defined('Auth_OpenID_VERIFY_HOST') &&
+ Auth_OpenID_VERIFY_HOST == true &&
$this->isHTTPS($url)) {
Auth_OpenID::log('OpenID: Verified SSL host %s using '.
'curl/get', $url);
@@ -202,8 +213,17 @@ function post($url, $body, $extra_headers = null)
array($this, "_writeData"));
if (defined('Auth_OpenID_VERIFY_HOST')) {
- curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true);
- curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
+ // set SSL verification options only if Auth_OpenID_VERIFY_HOST
+ // is explicitly set, otherwise use system default.
+ 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);
+ }
}
curl_exec($c);
@@ -217,7 +237,9 @@ function post($url, $body, $extra_headers = null)
return null;
}
- if (defined('Auth_OpenID_VERIFY_HOST') && $this->isHTTPS($url)) {
+ if (defined('Auth_OpenID_VERIFY_HOST') &&
+ Auth_OpenID_VERIFY_HOST == true &&
+ $this->isHTTPS($url)) {
Auth_OpenID::log('OpenID: Verified SSL host %s using '.
'curl/post', $url);
}
View
4 docs/detect.php
@@ -368,7 +368,7 @@ function_exists('posix_geteuid')) {
$out .= $r->p('If you are using the filesystem store, your ' .
'data directory must be readable and writable by ' .
- $web_user . ' and not availabe over the Web.');
+ $web_user . ' and not available over the Web.');
return true;
}
@@ -455,7 +455,7 @@ function detect_fetcher($r, &$out)
if ($url == $fetch_url) {
$msg = 'The redirected URL was not returned.';
} else {
- $msg = 'An unexpected URL was returned: <' . $url . '>.';
+ $msg = 'An unexpected URL was returned: ' . $url . '.';
}
$parts[] = $r->b($msg);
}
View
2 docs/discover.php
@@ -97,4 +97,4 @@ function escape($x)
}
?>
</body>
-</html>
+</html>
View
2 tests/Auth/OpenID/StoreTest.php
@@ -658,7 +658,7 @@ function test_mdb2store()
// The MDB2 test can use any database engine. MySQL is chosen
// arbitrarily.
if (!(extension_loaded('mysql') ||
- (function_exists('dl') && @dl('mysql.' . PHP_SHLIB_SUFFIX))) ||
+ (function_exists('dl') && @dl('mysql.' . PHP_SHLIB_SUFFIX))) ||
!(@include_once 'MDB2.php')) {
print "(not testing MDB2 store)";
$this->pass();

0 comments on commit 3b4dd38

Please sign in to comment.
Something went wrong with that request. Please try again.