Skip to content

Instantly share code, notes, and snippets.

@mugli
Last active January 5, 2016 23:33
Show Gist options
  • Save mugli/8716881 to your computer and use it in GitHub Desktop.
Save mugli/8716881 to your computer and use it in GitHub Desktop.
Using stud (The Scalable TLS Unwrapping Daemon) on Ubuntu 12.04

Using stud (The Scalable TLS Unwrapping Daemon) on Ubuntu 12.04

stud repo: https://github.com/bumptech/stud

###Compiling from source: stud on Ubuntu repository is outdated. Here's how to compile that from source:

  sudo apt-get install -y libev-dev libssl-dev git-core
  
  git clone git://github.com/bumptech/stud.git
  
  cd stud
  
  make && sudo make install

After that stud will be installed on /usr/local/stud

###Generating a self signed certificate:

  openssl genrsa -out test.com.key 1024
  
  openssl req -new -key test.com.key -out test.com.csr
  
  openssl x509 -req -days 365 -in test.com.csr -signkey test.com.key -out test.com.crt
  
  cat test.com.key test.com.crt > openssl genrsa -out test.com.key 1024
  
  openssl req -new -key test.com.key -out test.com.csr
  
  openssl x509 -req -days 365 -in test.com.csr -signkey test.com.key -out test.com.crt
  
  cat test.com.key test.com.crt > test.com.pem

We'll place test.com.pem to /cert/test.com.pem for stud on our server.

###Starting stud on boot After creating the following /etc/stud/studconfig.conf and /etc/init/stud.conf files, stud will be started after boot. To manually start/stop:

  sudo service stud start
  sudo service stud stop
### stud upstart script
### This file goes to /etc/init/stud.conf
description "stud - The Scalable TLS Unwrapping Daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env STUD=/usr/local/bin/stud
# Test the stud configuration (Upstart will not proceed if this fails)
pre-start exec $DAEMON -t -q --config /etc/stud/studconfig.conf
# Start stud
exec STUD -q --config /etc/stud/studconfig.conf
#bind to defualt SSL port
frontend = "[*]:443"
#haproxy host and port
backend = "[localhost]:80"
#location of the .pem file
pem-file = "/cert/test.com.pem"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment