Hello, I was trying to look into enabling SSL for my pi-hole. I know there are options for letsencrypt but I am not looking to make my pi-hole publicly available to the open internet. I have created a certificate for internal use and the root and intermediate CA has been deployed to the computers on my network.
I would like for SSL to be in place internally so nothing can sniff the password and other information if on the network. Yes I know that if I donβt trust things on my network I should fix that problem first but having extra layers does not hurt.
what type of web server your are running? And yes, if you donβt trust your local network, fix this first. Creating local SSL certificates dosneβt makes much sense and is causing more issues than it help. If there is someone in your network who is able to sniff stuff, you have other issues than getting PiHole compromised.
Currently I if I try and go to https version of the site Example: https://pi.hole I get
This site canβt be reached
pi.hole refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
In the tutorial that I posted above in section Applying the Certificates if I do the following commands from step 10
sudo ln -s /etc/lighttpd/conf-available/10-ssl.conf /etc/lighttpd/conf-enabled/10-ssl.conf
sudo service lighttpd restart
I get the following error:
Job for lighttpd.service failed because the control process exited with error code.
See "systemctl status lighttpd.service" and "journalctl -xe" for details.
I have since removed the 10-ssl.conf file from conf-enabled so I can restart the service.
This site canβt be reached
pi.hole refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
says that you cannot connect to the server. It doesnβt have to do directly with the certificates.
Check that the name resolves to the correct IP. Check that the IP is reachable (by ping or some other service). Check that the server is running on port 443 (sudo ss -tunlp | grep 443)
Finally make sure that the file names are correct and with proper upper/lower case.
I tried to activate it and lighttpd fails to start. I ran the command you stated and get the following:
2021-10-30 05:30:38: configfile.c.255) Warning: please add "mod_openssl" to server.modules list in lighttpd.conf. A future release of lighttpd 1.4.x *will not* automatically load mod_openssl and lighttpd *will not* use SSL/TLS where your lighttpd.conf contains ssl.* directives
2021-10-30 05:30:38: plugin.c.195) dlopen() failed for: /usr/lib/lighttpd/mod_openssl.so /usr/lib/lighttpd/mod_openssl.so: cannot open shared object file: No such file or directory
2021-10-30 05:30:38: server.c.1238) loading plugins finally failed
I add mod_openssl to the conf and, then it is still stuck with
2021-10-30 05:58:41: plugin.c.195) dlopen() failed for: /usr/lib/lighttpd/mod_openssl.so /usr/lib/lighttpd/mod_openssl.so: cannot open shared object file: No such file or directory
2021-10-30 05:58:41: server.c.1238) loading plugins finally failed
When I try and restart the service I get this as well:
Job for lighttpd.service failed because the control process exited with error code.
See "systemctl status lighttpd.service" and "journalctl -xe" for details.
systemctl status lighttpd.service gives:
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Control process exited, code=exited, status=255/EXCEPTION
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Oct 30 05:58:32 DietPi systemd[1]: Failed to start Lighttpd Daemon.
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Oct 30 05:58:32 DietPi systemd[1]: Stopped Lighttpd Daemon.
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Oct 30 05:58:32 DietPi systemd[1]: Failed to start Lighttpd Daemon.
and journalctl -xe gives:
Oct 30 05:58:32 DietPi systemd[1]: Stopped Lighttpd Daemon.
ββ Subject: A stop job for unit lighttpd.service has finished
ββ Defined-By: systemd
ββ Support: https://www.debian.org/support
ββ
ββ A stop job for unit lighttpd.service has finished.
ββ
ββ The job identifier is 27331 and the job result is done.
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Oct 30 05:58:32 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
ββ Subject: Unit failed
ββ Defined-By: systemd
ββ Support: https://www.debian.org/support
ββ
ββ The unit lighttpd.service has entered the 'failed' state with result 'exit-code'.
Oct 30 05:58:32 DietPi systemd[1]: Failed to start Lighttpd Daemon.
ββ Subject: A start job for unit lighttpd.service has failed
ββ Defined-By: systemd
ββ Support: https://www.debian.org/support
ββ
ββ A start job for unit lighttpd.service has finished with a failure.
ββ
ββ The job identifier is 27331 and the job result is failed.