SSL on RapsberryPi based PirateBox 1.1.x

Posted by Matthias 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
SSL on RapsberryPi based PirateBox 1.1.x
February 20, 2018 03:15PM
Hi guys,

as some of you really want to support SSL that hard, here are some steps to get it working. These steps are valid for Piratebox on RPi version 1.1.x.

1. Login as user alarm

2. Create the certificate:

sudo bash
mkdir /opt/piratebox/conf/lighttpd/certs/
cd /opt/piratebox/conf/lighttpd/certs/
openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 3650 -nodes
(hit enter several times if prompted)

source /opt/piratebox/conf/piratebox.conf
chown $LIGHTTPD_USER:$LIGHTTPD_GROUP lighttpd.pem
chmod 400 lighttpd.pem

cd /opt/piratebox/conf/lighttpd/
cat <<EOF > ssl.conf
\$SERVER["socket"] == ":443" {
    ssl.engine = "enable"
    ssl.pemfile = "/opt/piratebox/conf/lighttpd/certs/lighttpd.pem"
}
EOF

echo 'include "/opt/piratebox/conf/lighttpd/ssl.conf"' >>  lighttpd.conf
systemctl restart piratebox

Done. I would like to here your observations/ideas after testing.

best regards Matthias
Mike
Re: SSL on RapsberryPi based PirateBox 1.1.x
January 01, 2019 11:48PM
I've tried this exact setup on a RPi 3+ with no luck. When I type in [piratebox.lan], it redirects to http.
Cpt. Jack
Re: SSL on RapsberryPi based PirateBox 1.1.x
January 03, 2019 10:31PM
on my fresh setup this configuration dont work. the redirection is now complete disabled.

I dont get any errors during the configuration.
Re: SSL on RapsberryPi based PirateBox 1.1.x
January 04, 2019 02:57PM
You can only decide to run HTTP or HTTPS based.
If you want to have the "redirect all" pointing to the HTTPS version, you need to adjust:

/opt/piratebox/www/index.html
/opt/piratebox/src/redirect.html.schema

Exchange
Language: PHP
url=http://piratebox.lan/content"
to
Language: PHP
url=https://piratebox.lan/content"

best regards Matthias
Cpt. Jack
Re: SSL on RapsberryPi based PirateBox 1.1.x
January 07, 2019 09:18PM
This works now perfect!

Thank you Matthias