I'm hosting a webpage with Apache on a Raspberry Pi (Debian), and can't seem to get the server to issue the current certificate. I generated a self-signed SSL certificate in /home/pi/ssl/
with:
openssl req -new -sha256 -x509 -nodes -days 365 -out example.com.pem -keyout example.com.key
Apache looks up the .pem
and .key
file pair from file /etc/apache2/sites-enabled/owncloud.conf
, which contains:
SSLCertificateFile /home/pi/ssl/example.com.pem
SSLCertificateKeyFile /home/pi/ssl/example.com.key
When I delete these files and restart Apache I get error [FAIL] Reloading web server config: apache2 failed!
. This error doesn't happen when restarting after a new certificate file pair has been generated, so Apache does seem to be calling the certificate.
However the certificate that comes through in browsers (Chrome Incognito or FF/Safari private windows, and even a browser on a computer that surely never requested the domain before) is an old certificate I generated a month ago - see below:
Any ideas why this is happening?
openssl x509 -in /home/pi/ssl/example.com.pem -text -noout
to see which common name it shows?example.com
- see gistgrep -i -r "SSLCertificateChainFile" /etc/apache2/
showed/etc/apache2/sites-available/default-ssl
still had references to the default 'snakeoil' certificate. Commenting these out and the browser returns the customised certificate.sites-available
should not be used, unless linked intosites-enabled
... Still then: please post it as answer. :-)