SSL on RapsberryPi based PirateBox 1.1.x

Posted by Matthias 
SSL on RapsberryPi based PirateBox 1.1.x
February 20, 2018 04: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 02, 2019 12:48AM
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 11: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 03: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 10:18PM
This works now perfect!

Thank you Matthias
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
 ********  **     **  **      **  **               ** 
 **         **   **   **  **  **  **    **         ** 
 **          ** **    **  **  **  **    **         ** 
 ******       ***     **  **  **  **    **         ** 
 **          ** **    **  **  **  *********  **    ** 
 **         **   **   **  **  **        **   **    ** 
 ********  **     **   ***  ***         **    ******  
Message: