This post is gonna get geeky. I warned ya!
So... I figured it was about time that I started connecting to FurryMUCK via SSL so that other people couldn't sniff my session. Fink for OS X didn't seem to have support for TinyFugue with SSL, so I figured my best bet would be to use Stunnel to listen on a port on my machine, encrypt the data, and send it over to the FurryMUCK machine's SSL port.
Sounds simple, right? Well, under Stunnel version 3, it would have been. I could have started stunnel with one command that takes a few command line switches and I would be on my way. But Stunnel version 4 did away with the switches. Now you are forced to use a config file. It doesn't matter that upgrading to version 4 would completely and totally BREAK any site running version 3, or that the instructions on the stunnel.org FAQ are still for verison 3. For those of you who are free software authors out there, here's a hint: when releasing new versions of your software, do NOT depricate existing switches. EVER. Anyway..
[Edit: I was informed by
taral that one does not need to create a key when running in a client mode. But hey, these kinds of mistakes happen when the manpage throws all these switches at you and is pretty poor at providing examples.]
Now I needed to create a configuration file for Stunnel. Since FurryMUCK listens for SSL connections on port 8899, I decided that I would use that same port on my machine, so that connecting on port 8899 to my machine would encrypt the traffic with SSL and send it over to FurryMUCK's server. To do that, I used this configuration file:
#
# We're running in client mode, which means the remote side speaks SSL
#
client = yes
#
# Create the pid in our home directory. Normally, our home directory should
# not be world-writeable, so we shouldn't have to worry about symlink attacks
#
pid = /Users/doug/.stunnel.pid
#
# Configuration for FurryMUCK. Listen on port 8899 locally, encrypt with
# SSL, and forward to the SSL port of FurryMUCK
#
[furrymuck]
accept = localhost:8899
connect = muck.furry.com:8899
I tested this by running stunnel ~/bin/stunnel-mucks.ini, and then typing telnet localhost 8899. Sure enough, the login screen for FurryMUCK would come up!
Now, I wanted to modify TinyFugue so that it would connect to the new port. I added this line to my .tfrf file:
/addworld -Ttiny giza giza ******** localhost 8899
I modified the old line so that it read:
/addworld -Ttiny giza-nossl giza ******** localhost 8888
This way, if Stunnel or SSL is ever unavailalbe, I could still connect via an unencrpyted connection.
I started up TinyFugue, and sure enough, I got an encrypted connection to Furry MUCK. I could tell that the connection was encrypted by typing WHO giza, and looking for an asterisk next to my name.
The final step was to tie this all together. I didn't want to have to start up Stunnel everytime I wanted to connect to the MUCK, and I didn't want it using up memory when I wasn't connected. So I wrote this shell script:
#!/bin/sh
#
# Wrapper for executing the TinyFugue MUCK client program with SSL support.
#
#
# Location of TinyFugue
#
# -n means "don't load up our default world
#
TF="/usr/local/bin/tf -n"
#
# The name of our Stunnel PID file?
#
PID_FILE=$HOME/.stunnel.pid
#
# Figure out what directory we are running in
#
DIR=`dirname $0`
#
# Run stunnel using our config file
#
stunnel $DIR/stunnel-mucks.ini || exit $?
#
# Now actually run TinyFugue
#
$TF || exit $?
#
# We're done with stunnel, kill it off
#
kill `cat $PID_FILE`
That's uh, about all there is to it. Happy MUCKing. :-)
So... I figured it was about time that I started connecting to FurryMUCK via SSL so that other people couldn't sniff my session. Fink for OS X didn't seem to have support for TinyFugue with SSL, so I figured my best bet would be to use Stunnel to listen on a port on my machine, encrypt the data, and send it over to the FurryMUCK machine's SSL port.
Sounds simple, right? Well, under Stunnel version 3, it would have been. I could have started stunnel with one command that takes a few command line switches and I would be on my way. But Stunnel version 4 did away with the switches. Now you are forced to use a config file. It doesn't matter that upgrading to version 4 would completely and totally BREAK any site running version 3, or that the instructions on the stunnel.org FAQ are still for verison 3. For those of you who are free software authors out there, here's a hint: when releasing new versions of your software, do NOT depricate existing switches. EVER. Anyway..
[Edit: I was informed by
Now I needed to create a configuration file for Stunnel. Since FurryMUCK listens for SSL connections on port 8899, I decided that I would use that same port on my machine, so that connecting on port 8899 to my machine would encrypt the traffic with SSL and send it over to FurryMUCK's server. To do that, I used this configuration file:
#
# We're running in client mode, which means the remote side speaks SSL
#
client = yes
#
# Create the pid in our home directory. Normally, our home directory should
# not be world-writeable, so we shouldn't have to worry about symlink attacks
#
pid = /Users/doug/.stunnel.pid
#
# Configuration for FurryMUCK. Listen on port 8899 locally, encrypt with
# SSL, and forward to the SSL port of FurryMUCK
#
[furrymuck]
accept = localhost:8899
connect = muck.furry.com:8899
I tested this by running stunnel ~/bin/stunnel-mucks.ini, and then typing telnet localhost 8899. Sure enough, the login screen for FurryMUCK would come up!
Now, I wanted to modify TinyFugue so that it would connect to the new port. I added this line to my .tfrf file:
/addworld -Ttiny giza giza ******** localhost 8899
I modified the old line so that it read:
/addworld -Ttiny giza-nossl giza ******** localhost 8888
This way, if Stunnel or SSL is ever unavailalbe, I could still connect via an unencrpyted connection.
I started up TinyFugue, and sure enough, I got an encrypted connection to Furry MUCK. I could tell that the connection was encrypted by typing WHO giza, and looking for an asterisk next to my name.
The final step was to tie this all together. I didn't want to have to start up Stunnel everytime I wanted to connect to the MUCK, and I didn't want it using up memory when I wasn't connected. So I wrote this shell script:
#!/bin/sh
#
# Wrapper for executing the TinyFugue MUCK client program with SSL support.
#
#
# Location of TinyFugue
#
# -n means "don't load up our default world
#
TF="/usr/local/bin/tf -n"
#
# The name of our Stunnel PID file?
#
PID_FILE=$HOME/.stunnel.pid
#
# Figure out what directory we are running in
#
DIR=`dirname $0`
#
# Run stunnel using our config file
#
stunnel $DIR/stunnel-mucks.ini || exit $?
#
# Now actually run TinyFugue
#
$TF || exit $?
#
# We're done with stunnel, kill it off
#
kill `cat $PID_FILE`
That's uh, about all there is to it. Happy MUCKing. :-)
(no subject)
Date: 2004-09-13 03:34 am (UTC)You don't need a key/cert when using stunnel in client mode.
(no subject)
Date: 2004-09-13 04:33 am (UTC)I hate Stunnel 4.
(no subject)
Date: 2004-09-13 09:17 am (UTC)(no subject)
Date: 2004-09-13 06:17 pm (UTC)(no subject)
Date: 2004-09-13 03:35 am (UTC)(no subject)
Date: 2004-09-13 03:57 am (UTC)Since then, I've actually made the switch to running Trebuchet as my MUCK client, but I find I still use stunnel -- I have a script set up for making characters on a MUCK that I administer which uses it.
(no subject)
Date: 2004-09-13 04:35 am (UTC)(no subject)
Date: 2004-09-13 12:20 pm (UTC)(no subject)
Date: 2004-09-13 04:23 am (UTC)My reasoning is as follows: Except when it's actually moving data, it's going to be sitting in kernel-sleep, so it won't be using up any CPU. And while it's idle, if memory does get that loaded, the OS will happily to page it to disk where it will stay until I end up using it again. Stunnel isn't a big program, anyway. So although I don't think it was worth the trouble of scripting starting up/shutting down, it was clearly simple enough to do anyway. :)
(no subject)
Date: 2004-09-13 04:38 am (UTC)But I think it's a moot point, I'm gonna give Trebuchet (http://www.belfry.com/fuzzball/trebuchet/) a try sometime soon. And I can put it on my old Linux box, too!
(no subject)
Date: 2004-09-13 04:59 am (UTC)If you have a Linux box, you could always have stunnel permanently resident on there, and have your Mac TF connect to that Stunnel. Your packets would travel in the clear on your LAN between your Mac and your Linux box, but I presume you don't care about that.
Trebuchet is good too, I hear, although I'm still an old stick in the mud for TinyFugue.
stunnel
Date: 2004-09-13 04:25 am (UTC)Maybe check the dev forum for stunnel to see a) why they did it, and b) how much flack they've taken so far for it? The logical thing to do in response is to submit a patch that adds the old switches back in.
(no subject)
Date: 2004-09-13 01:28 pm (UTC)The only thing this really accomplishes is preventing anybody from snooping your password when you're connecting and authenticating to the game. Very few people beyond we hard-core geeks will use SSL to reach the game, so I view anything that goes "beyond the MUCK server" to another person's client as completely insecure.
Still, it's fun to toy around with. I wish it was a more frequently used option.
(no subject)
Date: 2004-09-13 02:10 pm (UTC)Basically the only change in v5.0b3 is it supports SSL. And it's rock solid.
Congrats on making it work though. Carefuly, someone will hear and you'll becomed stained as a sysadmin.
(no subject)
Date: 2004-09-13 02:18 pm (UTC)>Carefuly, someone will hear and you'll becomed stained as a sysadmin.
I'm afraid you're far too late...
(no subject)
Date: 2004-09-13 03:00 pm (UTC)Incedentally if you do a 'whodo' of folks on the muck, the at sign next to their time means they are SSL connected.
(no subject)
Date: 2004-09-13 06:21 pm (UTC)(no subject)
Date: 2004-09-13 06:30 pm (UTC)Why or why can't we all just get along and use an eBuild system like GenToo uses? Every package name just has a version attribute and all is good...