diff options
author | tailor <cygnus@janrain.com> | 2007-05-21 20:08:17 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2007-05-21 20:08:17 +0000 |
commit | 0469d359a8c58f6f032a836da166976510422b56 (patch) | |
tree | be5d7b00dbe804ff91af6de0788583bb21b6a316 /Auth/Yadis/PlainHTTPFetcher.php | |
parent | 90d28dfc0930d9f93215b4aec00b29f9be78896c (diff) | |
download | php-openid-0469d359a8c58f6f032a836da166976510422b56.zip php-openid-0469d359a8c58f6f032a836da166976510422b56.tar.gz php-openid-0469d359a8c58f6f032a836da166976510422b56.tar.bz2 |
[project @ Add SSL support detection to fetchers]
Diffstat (limited to 'Auth/Yadis/PlainHTTPFetcher.php')
-rw-r--r-- | Auth/Yadis/PlainHTTPFetcher.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Auth/Yadis/PlainHTTPFetcher.php b/Auth/Yadis/PlainHTTPFetcher.php index 5fac50d..242bf99 100644 --- a/Auth/Yadis/PlainHTTPFetcher.php +++ b/Auth/Yadis/PlainHTTPFetcher.php @@ -26,8 +26,17 @@ require_once "Auth/Yadis/HTTPFetcher.php"; * @package OpenID */ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher { + function supportsSSL() + { + return function_exists('openssl_open'); + } + function get($url, $extra_headers = null) { + if ($this->isHTTPS($url) && !$this->supportsSSL()) { + return null; + } + if (!$this->allowedURL($url)) { trigger_error("Bad URL scheme in url: " . $url, E_USER_WARNING); @@ -137,6 +146,10 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher { function post($url, $body, $extra_headers = null) { + if ($this->isHTTPS($url) && !$this->supportsSSL()) { + return null; + } + if (!$this->allowedURL($url)) { trigger_error("Bad URL scheme in url: " . $url, E_USER_WARNING); |