Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/apache-httpd: SSL requests fail in PHP because of missing certificates #10703

Closed
cschomburg opened this issue Oct 29, 2015 · 2 comments
Closed

Comments

@cschomburg
Copy link

When using simple PHP in Apache, all SSL functions fail at certificate verification (e.g. file_get_contents("https://google.com") or stream_socket_client()). Looks like Apache does not find the system root certificates.

OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

{
  services.httpd = {
    enable = true;
    enablePHP = true;
  };
}

Adding { systemd.services.httpd.environment.SSL_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt"; } fixes this. Looks like it's related to #8247.

@cleverca22
Copy link
Contributor

the same problem exists in services.phpfpm

systemd.services.phpfpm.environment.SSL_CERT_FILE = "/etc/ssl/certs/ca-bundle.crt";

and the above doesn't fix it
i was able to fix it by copying php-recommended.ini from the php package and making the following change, then using services.phpfpm.phpIni = ./php-recommended.ini;

[openssl]
openssl.cafile=/etc/ssl/certs/ca-bundle.crt

but now i have to manually keep that version in-sync with php if any security/compat changes happen

@zimbatm
Copy link
Member

zimbatm commented Mar 17, 2016

Is this still an issue ? #12748 should have fixed this. Please let me know if I'm mistaken.

@zimbatm zimbatm closed this as completed Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants