[SOLVED] error SSL3_GET_SERVER_CERTIFICATE

Problems with the Linux version of XAMPP, questions, comments, and anything related.

[SOLVED] error SSL3_GET_SERVER_CERTIFICATE

Postby Torp » 17. February 2015 16:47

Hi,
When I try to execute a php script, which has to read a file from a https://path/to/my/repository, I get the following error:
Code: Select all
Warning:  file(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

and the pice of my code is:
Code: Select all
<?php
$lines = file("https://bitbucket.org/path/to/my/repository)
...
?>


I have already installed the package php5-curl and in my /opt/lampp/etc/php.ini I've pasted the line
Code: Select all
extension=/usr/lib/php5/20121212/curl.so
and restarted Apache, but nothing.

Looking for this issue on google I found that a possible solution is to set CURLOPT_SSL_VERIFYPEER to false, but doing so I will allow possible external attacks.
This seems to be a common problem under Windows, but under Linux I didn't find any way out.
Any idea how to fix the problem?
Thanks

---
More info:
Apache Version Apache/2.4.10 (Unix) OpenSSL/1.0.1j PHP/5.6.3 mod_perl/2.0.8-dev Perl/v5.16.3
cURL support enabled
cURL Information 7.30.0
SSL Yes
TLS-SRP Yes
OpenSSL support enabled
SSL Version OpenSSL/1.0.1j
Last edited by Torp on 18. February 2015 09:49, edited 1 time in total.
Torp
 
Posts: 3
Joined: 02. December 2014 12:04
Operating System: Xubuntu 14.04

[SOLVED] error SSL3_GET_SERVER_CERTIFICATE

Postby Torp » 18. February 2015 09:48

I figure out that it's a problem of certificates.

According to http://docs.php.net/manual/en/migration56.openssl.php#migration56.openssl.default-certificate-paths my output is:
Code: Select all
array(8) { ["default_cert_file"]=> string(33) "/opt/lampp/share/openssl/cert.pem" ["default_cert_file_env"]=> string(13) "SSL_CERT_FILE" ["default_cert_dir"]=> string(30) "/opt/lampp/share/openssl/certs" ["default_cert_dir_env"]=> string(12) "SSL_CERT_DIR" ["default_private_dir"]=> string(32) "/opt/lampp/share/openssl/private" ["default_default_cert_area"]=> string(24) "/opt/lampp/share/openssl" ["ini_cafile"]=> string(0) "" ["ini_capath"]=> string(14) "" }

The problem is that PHP hasn't got any valid certificate. Therefore, in my php.in, I tell to him to look for them in /etc/ssl/certs, namely:
Code: Select all
openssl.capath=/etc/ssl/certs


Now, it seems to work..

Bye
Torp
 
Posts: 3
Joined: 02. December 2014 12:04
Operating System: Xubuntu 14.04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 7 guests