stunnel: FAQ
Stunnel FAQ
Troubleshooting
"Could not find your SSL library installation dir" when running configure
The other possibility is that you installed your SSL library in a non-standard
place. Use the --with-ssl directive when running
configure to tell it where this directory is.
Configure is not finding my TCP Wrapper installation
/opt/tcpd_7.6. To help gcc find your include files and libraries,
you should set three environment variables as follows:
CFLAGS="$CFLAGS -I/opt/tcpd_7.6/include" CPPFLAGS="$CPPFLAGS -I/opt/tcpd_7.6/include" LDFLAGS="$LDFLAGS -L/opt/tcpd_7.6/lib" export CFLAGS CPPFLAGS LDFLAGSAnd then re-run
configure. This is the generic way to have
configure find specific libraries, and is not specific to stunnel
itself.
What to do when stunnel fails
- run with full debug mode
debug = 7 - if running the daemon, run it in the foreground
foreground = yes
I do not have the openssl binary / Cannot make stunnel.pem!
When I run stunnel, it just sits there, it does not listen for requests!
[service] definition in your config.
For example:
pid = /stunnel.pid setuid = nobody setgid = nobody debug = local6.err foreground = no client = yes [mysyslog] accept = localhost:syslog connect = logging:syslogsWithout that
[mysyslog] line, stunnel assumes you want to
operate in inetd-style mode.
I get the error "Wrong permissions on stunnel.pem"
I get the errorstunnel[PID]: Wrong permissions on /path/to/stunnel.pemon my stunnel server or on stunnel client using client-side certificates.
The stunnel.pem file contains your key (private data) and certificate (public data). In order for stunnel to start automatically without requiring a password, the key is created without a password. This means that anyone who can read this file can compromise your SSL security. This file must be readable only by root, or the user who runs stunnel.
Use the chmod command to fix permissions on this file, ala
chmod 600 /path/to/stunnel.pem
FTP over stunnel does not work
Alternatively you could use a different protocol. All versions of SSH include a
program called scp which works like rcp. Recent
versions of OpenSSH include a program called sftp which has an
ftp-like feel.
Stunnel does not work with Windows with strong crypto
Stunnel does not work with Windows 2000 (Outlook Express)
The error looks like the following:SSL_accept:error:140760F8:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol SSL_accept:error:1409B0AB:SSL routines:SSL3_SEND_SERVER_KEY_EXCHANGE:missing tmp rsa key
It is not determined if this applies to merely Outlook, or Windows 2000 in general, however it is a good idea to update your machine.
How do I configure Outlook to use SSL?
Stunnel fails with a "PRNG not seeded" error message
- Use PRNGd (Portable Random Number Generator Daemon) available
here.
This is an EGD compatible random number generator. It gathers entropy from
system commands and feeds them to the OpenSSL RNG, and thus will never block
waiting for more random data. Point to your PRNGd socket with
EGD = /path/to/sockargument to stunnel. - Use EGD (Entropy Gathering Daemon) available
here.
EGD was the first widely used RNG that got its entropy from system commands.
Unfortunately EGD can block (ie hang) until it gathers enough entropy. (For
this reason PRNGd is preferred over EGD.) Point to your EGD socket with
EGD = /path/to/sockargument to stunnel. - If you are running Solaris, snag the SUNWski patch, which will create
/dev/random for you. Simply
ln -s random /dev/urandomand OpenSSL (and thus stunnel) will find entropy for you automatically.
This patch has been reported to be available as part of the following patches, YMMV:105710-01, 106754-01, 106755-01, 106756-01.
On Solaris 8 you could install patch 112438 to get /dev/random and /dev/urandom devices. - In the worst case you can create a file or files with random data (for
example copy sections of your running kernel to a file) and use them to seed
the data. See the stunnel manual page RANDOMNESS section for the full list of
which files are searched and in which order. It is important to remember that
these random data files may be overwritten unless
RNDoverwrite = nooption is used.
Secure Password Authentication error with Outlook and POP
When I try to use pop with Outlook I get the following error:
Unable to logon to the server using Secure Password Authentication. Account:
'example.net', Server: 'mail.example.net', Protocol: POP3, Server Response:
'.', Port: 995, Secure(SSL): Yes, Error Number: 0x800CCC18
Help! I run on Linux with threads, but stunnel keeps forking off processes anyway!
If you have arguments against this way of implementing threads, talk to Linus. Linux threads are damned fast as they are, so you are not likely to convince him to change things.
Stunnel also spawns its libwrap client processes at startup, as libwrap code is not thread-safe.
Stunnel hangs for a while accepting connections
/etc/resolv.conf each failed query takes
time to expire. DNS fail-over causes severe slowdown of stunnel.
We suggest any or all of the following:
- Fix your /etc/resolv.conf
- Make sure your machines have reverse DNS entries. It is just a good practice anyway.
- Try accessing a closer name server first in your resolv.conf
- Consider running a caching nameserver on your local host and pointing to it first
Stunnel is complaining that there are too many open files and is refusing new connections
For a quick glance at how to change this parameter on Solaris, go here.
My connections are slow, slow, slow
socket = l:TCP_NODELAY=1and on the client include:
socket = r:TCP_NODELAY=1
Are there any special problems with stunnel and IE?
Currently stunnel implements ugly 10-seconds timeout to work with Microsoft... I hate it, but several peple need it.
See RFC 2246 chapter 7.2.1. for details.
I am running out of processes/file descriptors on Solaris
* set hard limit on file descriptors set rlim_fd_max = 4096 * set soft limit on file descriptors set rlim_fd_cur = 1024
TCP Wrappers do not work as expected
chroot = /path/to/chroot/Then you need to create /path/to/chroot/etc and put your hosts.allow and hosts.deny files there:
mkdir /path/to/chroot/etc cp /etc/hosts.allow /etc/hosts.deny /path/to/chroot/etcMake sure that you change these files, not the global /etc/hosts.{allow.deny} files.
My web browser cannot talk to stunnel
2003.01.18 17:46:07 LOG3[6093:32770]: SSL_accept: 1407609C:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request
then your stunnel runs in server mode (without client = yes) and
your web browser is connecting to it as if it is a normal webserver, ala
http://example.com/.
If stunnel is supposed to be running as a client, then fix your
stunnel.conf. If you do mean to be running as an SSL server then
point your browser at https://host:port/ instead of http://host:port/.
Problems tunneling telnet over stunnel with AIX
Some users also recommended using telnetd -a or
telnetd -R as a workaround.
Eudora keeps saying "error reading network"
Another solution reported to work is adding
options = DONT_INSERT_EMPTY_FRAGMENTSto stunnel.conf.
Applications
This section gives you some information on how getting to work with other applications.Can I forward UDP services over stunnel?
There are also other programs that do this natively, and could be used standalone or via stunnel, such as Zebedee. If you have any success tunneling UDP over stunnel, please contact the faq maintainer so we can write up a good HOWTO for folks.
Can I use stunnel to communicate across a firewall?
You're most likely to convince your firewall administrator to allow secure traffic from inside to outside. In fact, if your firewall is doing NAT, you can probably stunnel out from your machine to an internet machine without any firewall re-configuration.
Specifically, have your firewall administrator allow outbound connections from your machine to the remote (internet) machine on the specific port you wish to connect to.
Be sure to discuss these issues with your administrator. They don't enjoy people penetrating their firewalls without their consent.
Can I use stunnel to securely connect two subnets across the Internet?
- Use tappipe
- Run PPP over a regular stunnel connection
Can I use stunnel to protect [insert random protocol here]?
- The protocol is TCP, not UDP.
- The protocol doesn't use multiple connections, like ftp.
- The protocol doesn't depend on Out Of Band (OOB) data,
- Remote site can't use an application-specific protocol, like ssltelnet,
where SSL is a negotiated option, save for those protocols already supported
by the
protocolargument to stunnel.
Miscellaneous
What is Session Cache?
A client offers to reuse a session ID. If the server recognizes it then they will skip the whole cipher/etc determination phase, which results in smaller overhead. This is called a cache hit. (the session id cache is where these session ids are.)
A session id cache miss means that the client either does not have a session id it can use, or the server does not recognize it. Thus they negotiate ciphers all over again.
What are the offical SSL ports?
nsiiops 261/tcp # IIOP Name Service over TLS/SSL https 443/tcp # http protocol over TLS/SSL smtps 465/tcp # smtp protocol over TLS/SSL (was ssmtp) nntps 563/tcp # nntp protocol over TLS/SSL (was snntp) imap4-ssl 585/tcp # IMAP4+SSL (use 993 instead) sshell 614/tcp # SSLshell ldaps 636/tcp # ldap protocol over TLS/SSL (was sldap) ftps-data 989/tcp # ftp protocol, data, over TLS/SSL ftps 990/tcp # ftp protocol, control, over TLS/SSL telnets 992/tcp # telnet protocol over TLS/SSL imaps 993/tcp # imap4 protocol over TLS/SSL ircs 994/tcp # irc protocol over TLS/SSL pop3s 995/tcp # pop3 protocol over TLS/SSL (was spop3) msft-gc-ssl 3269/tcp # Microsoft Global Catalog with LDAP/SSL
How do I know which encryption ciphers are available?
ciphers option) are determined by your OpenSSL library. To list
the available ciphers, run the following:
openssl ciphers -v
How can I delay DNS lookups until connect time?
delay = yes
How can I convert a certificate from der format (.cer) to PEM format?
openssl x509 -in file.cer -inform d -out file.pem