Index: trunk/extensions/Collection/Collection.php |
— | — | @@ -43,6 +43,9 @@ |
44 | 44 | /** Login credentials to this MediaWiki as 'USERNAME:PASSWORD' string */ |
45 | 45 | $wgCollectionMWServeCredentials = null; |
46 | 46 | |
| 47 | +/** PEM-encoded SSL certificate for the mw-serve render server to pass to CURL */ |
| 48 | +$wgCollectionMWServeCert = null; |
| 49 | + |
47 | 50 | /** Namespace for "community collections" */ |
48 | 51 | $wgCommunityCollectionNamespace = NS_MEDIAWIKI; |
49 | 52 | |
Index: trunk/extensions/Collection/README.txt |
— | — | @@ -70,6 +70,11 @@ |
71 | 71 | Note that the MediaWiki must be accessible from the render server, i.e. if |
72 | 72 | your MediaWiki is behind a firewall you cannot use the public render server. |
73 | 73 | |
| 74 | + *$wgCollectionMWServeCert (string)* |
| 75 | + Filename of a SSL certificate in PEM format for the mw-serve render server. |
| 76 | + This needs to be used for self-signed certificates, otherwise CURL will |
| 77 | + throw an error. The default is null, i.e. no certificate. |
| 78 | + |
74 | 79 | *$wgCollectionMWServeCredentials (string)* |
75 | 80 | Set this to a string of the form "USERNAME:PASSWORD" (or |
76 | 81 | "USERNAME:PASSWORD:DOMAIN" if you're using LDAP), if the MediaWiki |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -1312,7 +1312,8 @@ |
1313 | 1313 | static function post( $url, $postFields, &$errorMessage, &$headers, |
1314 | 1314 | $timeout=true, $toFile=null ) { |
1315 | 1315 | global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle; |
1316 | | - |
| 1316 | + global $wgCollectionMWServeCert; |
| 1317 | + |
1317 | 1318 | $c = curl_init( $url ); |
1318 | 1319 | curl_setopt($c, CURLOPT_PROXY, $wgHTTPProxy); |
1319 | 1320 | curl_setopt( $c, CURLOPT_USERAGENT, "MediaWiki/$wgVersion" ); |
— | — | @@ -1325,6 +1326,14 @@ |
1326 | 1327 | if ( $timeout ) { |
1327 | 1328 | curl_setopt( $c, CURLOPT_TIMEOUT, $wgHTTPTimeout ); |
1328 | 1329 | } |
| 1330 | + /* Allow the use of self-signed certificates by referencing |
| 1331 | + * a local (to the mediawiki install) copy of the signing |
| 1332 | + * certificate */ |
| 1333 | + if ( !($wgCollectionMWServeCert === null) ) { |
| 1334 | + curl_setopt ($c, CURLOPT_SSL_VERIFYPEER, TRUE); |
| 1335 | + curl_setopt ($c, CURLOPT_CAINFO, $wgCollectionMWServeCert); |
| 1336 | + } |
| 1337 | + |
1329 | 1338 | $headerStream = tmpfile(); |
1330 | 1339 | curl_setopt( $c, CURLOPT_WRITEHEADER, $headerStream ); |
1331 | 1340 | if ( $toFile ) { |