Index: branches/wmf/1.16wmf4/includes/HttpFunctions.php |
— | — | @@ -15,15 +15,17 @@ |
16 | 16 | * @param $method string HTTP method. Usually GET/POST |
17 | 17 | * @param $url string Full URL to act on |
18 | 18 | * @param $options options to pass to HttpRequest object |
19 | | - * Possible keys for the array: |
20 | | - * timeout Timeout length in seconds |
21 | | - * postData An array of key-value pairs or a url-encoded form data |
22 | | - * proxy The proxy to use. Will use $wgHTTPProxy (if set) otherwise. |
23 | | - * noProxy Override $wgHTTPProxy (if set) and don't use any proxy at all. |
24 | | - * sslVerifyHost (curl only) Verify the SSL certificate |
25 | | - * caInfo (curl only) Provide CA information |
26 | | - * maxRedirects Maximum number of redirects to follow (defaults to 5) |
27 | | - * followRedirects Whether to follow redirects (defaults to true) |
| 19 | + * Possible keys for the array: |
| 20 | + * timeout Timeout length in seconds |
| 21 | + * postData An array of key-value pairs or a url-encoded form data |
| 22 | + * proxy The proxy to use. |
| 23 | + * Will use $wgHTTPProxy (if set) otherwise. |
| 24 | + * noProxy Override $wgHTTPProxy (if set) and don't use any proxy at all. |
| 25 | + * sslVerifyHost (curl only) Verify hostname against certificate |
| 26 | + * sslVerifyCert (curl only) Verify SSL certificate |
| 27 | + * caInfo (curl only) Provide CA information |
| 28 | + * maxRedirects Maximum number of redirects to follow (defaults to 5) |
| 29 | + * followRedirects Whether to follow redirects (defaults to true) |
28 | 30 | * @returns mixed (bool)false on failure or a string on success |
29 | 31 | */ |
30 | 32 | public static function request( $method, $url, $options = array() ) { |
— | — | @@ -127,6 +129,7 @@ |
128 | 130 | protected $proxy = null; |
129 | 131 | protected $noProxy = false; |
130 | 132 | protected $sslVerifyHost = true; |
| 133 | + protected $sslVerifyCert = true; |
131 | 134 | protected $caInfo = null; |
132 | 135 | protected $method = "GET"; |
133 | 136 | protected $reqHeaders = array(); |
— | — | @@ -168,7 +171,7 @@ |
169 | 172 | } |
170 | 173 | |
171 | 174 | $members = array( "postData", "proxy", "noProxy", "sslVerifyHost", "caInfo", |
172 | | - "method", "followRedirects", "maxRedirects" ); |
| 175 | + "method", "followRedirects", "maxRedirects", "sslVerifyCert" ); |
173 | 176 | foreach ( $members as $o ) { |
174 | 177 | if ( isset($options[$o]) ) { |
175 | 178 | $this->$o = $options[$o]; |
— | — | @@ -726,6 +729,10 @@ |
727 | 730 | if ( isset( $this->sslVerifyHost ) ) { |
728 | 731 | $this->curlOptions[CURLOPT_SSL_VERIFYHOST] = $this->sslVerifyHost; |
729 | 732 | } |
| 733 | + |
| 734 | + if ( isset( $this->sslVerifyCert ) ) { |
| 735 | + $this->curlOptions[CURLOPT_SSL_VERIFYPEER] = $this->sslVerifyCert; |
| 736 | + } |
730 | 737 | |
731 | 738 | if ( $this->caInfo ) { |
732 | 739 | $this->curlOptions[CURLOPT_CAINFO] = $this->caInfo; |
Property changes on: branches/wmf/1.16wmf4/includes/HttpFunctions.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
733 | 740 | Merged /trunk/phase3/includes/HttpFunctions.php:r65532 |