Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I generated an SSL certificate as specified on the answer to stunnel: SSL-to-SSL? (for smtp/imap) And have the following configuation file:

cert = /home/marshall/stunnels/certs/umistunnel.keys

; protocol version (all, SSLv2, SSLv3, TLSv1)
sslVersion = SSLv3

pid = ./stunnel4.pid

[https]
accept  = 4433
connect = 3000

When I run

> stunnel config.conf

the error I get is:

Reading configuration from descriptor 3
Snagged 64 random bytes from /home/marshall/.rnd
Wrote 1024 new random bytes to /home/marshall/.rnd
PRNG seeded successfully
Line 1: End of section stunnel: SSL server needs a certificate

If I instead run:

> stunnel filethatdoesnotexist.asdf

I get the same result. And, if I run stunnel without any parameters, the only change is that the error states Line 0. What am I doing wrong here?

share|improve this question
    
What version of stunnel is installed? –  Zoredache Sep 5 '12 at 17:31
    
It looks like version 4.05... –  Marshall Anschutz Sep 5 '12 at 18:18
add comment

3 Answers

You may have both stunnel3 & stunnel4 installed on your system.

The default for "stunnel" is to softlink it to stunnel3:

root@sibelius:/usr/bin# ls -l stunnel*
lrwxrwxrwx 1 root root      8 Oct 18  2011 stunnel -> stunnel3
-rwxr-xr-x 1 root root   2797 Oct 18  2011 stunnel3
-rwxr-xr-x 1 root root 109904 Oct 18  2011 stunnel4

The syntax of the stunnel.conf for stunnel3 is not compatible with the one for stunnel4.

Hence the error. Try removing stunnel3.

share|improve this answer
add comment
up vote 2 down vote accepted

Found my problem... It's not really documented (at least on my Ubuntu system). If I run the command

> stunnel4 config.conf

Then everything works, and all output shows up in the debug log file (if configured in the config file).

share|improve this answer
add comment

put the cert line in [https] also.

share|improve this answer
    
I added an identical (cert) line immediately under the [https] line, but it still gives the same error (and yes, I did verify that the file exists.) –  Marshall Anschutz Sep 5 '12 at 17:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.