From charlesreid1

A Guide to Debugging Stunnel Connections

Start with Stunnel

Debugging stunnel is a lot easier if you can run stunnel in the foreground in one window, and monitor its output activity while you try and connect. This is true of monitoring stunnel on both the client side and the server side.

Just add these two lines to your stunnel.conf:

debug = 7
foreground = yes

Now, when you run the stunnel command, the output will be shown directly on the screen, and you'll be able to monitor what's happening with stunnel when you try and connect.

For example stunnel.conf files, see the following links:

There are also some wiki files with config files:


Monitor stunnel log

check the log via:

[remote] $ tail -f /var/log/stunnel4/stunnel.log

Check your ports

Use nmap to scan the server and verify the external port you specified the stunnel server and client to use (443, or 273, or 8000, or whatever) should show up in the nmap scan as "open".

If you can't reach the server, you might have a firewall issue. Fix the firewall by using iptables.

#!/bin/bash
port=443
iptables -A INPUT -p tcp --dport ${port} -j ACCEPT
iptables -A FORWARD -p tcp -j ACCEPT --dport ${port} -m state --state NEW

Flags