www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - PHP: fetch an URL via SSL

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Brad Roberts is trying to switch bugzilla to use https, which breaks 
https://github.com/D-Programming-Language/dlang.org/blob/master/
etch-issue-cnt.php. 
He's not a PHP guy so he wouldn't know how to fix it. Could I trust one 
of our contributors to take on this task?

Thanks,

Andrei
Apr 02 2014
next sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Wednesday, 2 April 2014 at 20:28:07 UTC, Andrei Alexandrescu 
wrote:
 Brad Roberts is trying to switch bugzilla to use https, which 
 breaks 
 https://github.com/D-Programming-Language/dlang.org/blob/master/
etch-issue-cnt.php. 
 He's not a PHP guy so he wouldn't know how to fix it. Could I 
 trust one of our contributors to take on this task?

 Thanks,

 Andrei

The code is fine as is. The problem is PHP needs to be built with SSL support and the php installation on dlang.org wasn't. The only person who can fix this is Jan, I believe. The error message it gave until I switched it back to http was: "Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?"
Apr 02 2014
prev sibling next sibling parent Brad Roberts <braddr puremagic.com> writes:
On 4/2/14, 1:28 PM, Andrei Alexandrescu wrote:
 Brad Roberts is trying to switch bugzilla to use https, which breaks
 https://github.com/D-Programming-Language/dlang.org/blob/master/
etch-issue-cnt.php. He's not a PHP
 guy so he wouldn't know how to fix it. Could I trust one of our contributors
to take on this task?

 Thanks,

 Andrei

I pointed you to a url that contains a couple excellent answers this morning: http://stackoverflow.com/questions/1975461/file-get-contents-with-https From that page, the primary problem is the php install on dlang.org's webserver lacks either configuration or a php extension and it's configuration: Add this to the php config file: extension=php_openssl.dll allow_url_fopen = On Alternately, if the curl extension is installed, it looks like this code would be an alternative implementation: function getSslPage($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); curl_close($ch); return $result; } But the community doesn't have access to the server, so the best anyone external can do is provide this sort of data or setup an external proxy server, which is a horrible solution.
Apr 02 2014
prev sibling next sibling parent "Orvid King" <blah38621 gmail.com> writes:
On Wed, 02 Apr 2014 15:32:24 -0500, Brad Anderson <eco gnuk.net> wrote:

 On Wednesday, 2 April 2014 at 20:28:07 UTC, Andrei Alexandrescu wrote:
 Brad Roberts is trying to switch bugzilla to use https, which breaks  
 https://github.com/D-Programming-Language/dlang.org/blob/master/
etch-issue-cnt.php.  
 He's not a PHP guy so he wouldn't know how to fix it. Could I trust one  
 of our contributors to take on this task?

 Thanks,

 Andrei

The code is fine as is. The problem is PHP needs to be built with SSL support and the php installation on dlang.org wasn't. The only person who can fix this is Jan, I believe. The error message it gave until I switched it back to http was: "Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?"

Specifically, you need to enable the OpenSSL plugin, if you're using a copy of php installed from a package manager, it is typically in a separate package, and, depending on the distro, will enable itself when you install it. Once that is enabled, the code will work perfectly.
Apr 02 2014
prev sibling next sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Wednesday, 2 April 2014 at 20:28:07 UTC, Andrei Alexandrescu 
wrote:
 Brad Roberts is trying to switch bugzilla to use https, which 
 breaks 
 https://github.com/D-Programming-Language/dlang.org/blob/master/
etch-issue-cnt.php. 
 He's not a PHP guy so he wouldn't know how to fix it. Could I 
 trust one of our contributors to take on this task?

More discussion here: https://d.puremagic.com/issues/show_bug.cgi?id=12459
Apr 02 2014
prev sibling parent "Kagamin" <spam here.lot> writes:
Just noticed: on the index page for digitalmars.D.bugs in section 
"Also via" link to bugzilla leads to unencrypted site.
Apr 04 2014