How to set up Crypto Ancienne as a TLS proxy

Crypto Ancienne is Cameron Kaiser's great TLS library for the
Internet Of Old Things. Crypto Ancienne can be run in proxy mode,
which is a great way to offload SSL/TLS encryption from your 68k
or PowerPC Macintosh and be able to browse the modern web again
using e.g. MacLynx.

Let's set it up on a Linux machine running a Debian Linux
derivative (like Ubuntu, Raspbian, Rasberry Pi OS etc).


First, let's install the tools you'll need if you don't already
have them on your machine. Run the following command with root
priviledges to install some software prerequisites:

       apt-get update && apt-get install gcc xinetd git


Next, let's get the current Crypto Ancienne source code:

       git clone https://github.com/classilla/cryanc


Now you'll have a folder called cryanc as a sub directory from
where you ran the command. Move into cryanc using the command:

       cd cryanc


Let's compile carl, the included proxy application using Crypto
Ancienne as it's TLS library. Run the following command within
the cryanc folder to compile carl:

       gcc -O3 -o carl carl.c


You should now have a binary in the cryanc folder named carl.
Let's make make it executable using the following command:

       chmod +x carl


Let's move carl to somewhere better, like /usr/local/bin where we
intend to run it from:

       mv carl /usr/local/bin


Now let's configure and enable xinetd, the deamon that will run
carl as a service on our machine. Let's go into the xinetd
configuration directory:

       cd /etc/xinetd.d


And let's create a new configuration file using our favorite
editor. I'll use GNU Nano for this guide:

       nano carl


Let's configure carl like this:

service carl
{
       disable         = no
       socket_type     = stream
       protocol        = tcp
       port            = 8765
       wait            = no
       user            = root
       server          = /usr/local/bin/carl
       server_args     = -p -t
}


The server argument -p is to tell carl to run in proxy mode and
-t is to turn off the timer (to let our old Macs respond when
they can without timing out).

Let's enable and start xinetd using the following command:

       systemctl enable xinetd && systemctl start xinetd


Everything should now be up and running and you should be able to
reach carl (and Crypto Ancienne) on port 8765.

Happy surfing!