TLS encryption for Client/Server IPv6/IPv4 communication
What is ucspi-ssl?
sslserver, sslclient, and sslhandle are command-line tools for building SSL client-server applications. They conform to the UNIX Client-Server Program Interface, UCSPI.
sslserver listens for IPv6 and/or IPv4 connections, and runs a program for each connection it accepts. The program environment includes variables that hold the local and remote host names, IP addresses, and port numbers. sslserver offers a concurrency limit on acceptance of new connections, and selective handling of connections based on client identity supporting CIDR IP address notation. sslserver supports STARTTLS and STLS.
sslclient requests a connection to either a IPv6 or IPv4 TCP sockets, and runs a program. The program environment includes the same variables as for sslserver.
- ucspi-ssl 0.98b [MD5 = 4c31fa5877732ca9433f097e0619ce8a]
- ucspi-ssl 0.84 (IPv4 only) [MD5 = 3a3347d1b80e9962a0bab49b0b4d8692]
- ucspi-ssl Doxygen documentation
ucspi-ssl 0.9x is a fork of Superscript's ucspi-ssl 0.70 version, including
- Scott Gifford's STARTTLS extensions,
- certificate chaining support,
- SubAltName recognition for FQDN verification, and
- CIDR support for the cdb to filter IPv4/IPv6 connections.
- IPv6 enhancements are taken mainly from Felix von Leitner.
Note: Due the IPv6 support, the command-line arguments for the respective programs are slightly changed.
- ucspi-ssl 0.93 is streamlined with ucspi-tls6 1.00
- ucspi-ssl 0.94 provides for sslserver an extended client (user) X.509 cert support.
- ucspi-ssl 0.95 allows sslserver to log the SSL protocol and cipher settings by means of option -V:
@4000000054b2cd36310b0fb4 sslserver: ssl 20791 accept TLSv1:AES128-SHA While SSL negotation is disabled by default (prevent Poodle bug), TLSv1 can be switched off prior of compilation modifying the file ucspissl.h.
- ucspi-ssl-0.95b detects automatically the AMD64 environment and in addition the support for dynamic load libraries as required by some Linux systems.
- ucspi-ssl-0.96 fixes a problem for sslserver's paranoid IPv4 address evaluation in case a DNS AAAA in addition to a A record exists.
- ucspi-ssl-0.97 includes now the ECDH Elliptic Curve handshake.
It fixes a potential segfault bug in the CIDR IP address evaluation and gets rid of most compiler warnings. Thanks to Frank Bergmann and Troy for those enhancements.
- ucspi-ssl-0.98 supports now LibreSSL's API
and fixes a long time (poll) resource problem (tx. again Frank Bergmann).
Version 0.98b conforms to Gentoo's package building requirements.
This is facilited by means the lib ucspissl.a (after compilation; located in ./compile) and the header file ucspissl.h.
How to install ucspi-ssl
ucspi-ssl uses D.J. Bernstein's /package conventions for installation.
Typically, un-tar the archive under /package, change to host/superscript.com/net/ucspi-ssl-<version>
and calling package/install would be enough.
ucspi-ssl is pre-packaged to suite the AMD64 environment.
Depending on your Perl settings, you rather succeed with package/install base and package/man for the additional man-pages.
Note: The additional Perl module and the available tests package/rts may not succeed on every Unix plattform.
Description of the programs
Client and Servers:
In oder to build the cdb to control incoming connetions for sslserver, the program tcprules is required which comes with the ucspi-tcp6 package. Older versions of ucspi-tcp can be used as well, but don't provide neither IPv4 CIDR nor IPv6 capabilities. The generated cdb however, is binary compatible among all versions.
- My SMTP and Transport Layer Security (TLS) tutorial.
- The original ucspi-ssl source created by W.E. Baxter.
- Scott Gifford's STARTTLS UCPI-SSL extension.
- A Polish translation provided by Daniela Milton can be found here.
- A French translation done by Silvia Moraru can be found here.
- An Indonesian translation has been added by Eimantas B.: ucspi-ssl-Indonesian.
Note: These sites may refer to outdated versions of ucspi-ssl.
TLS environment & security
ucspi-ssl's sslserver will display the current Cipher settings, in case the flag -V is provided. Sample of the output using multilog:
Here, ECDHE-RSA-AES128-SHA is the negotiated Cipher in use together with TLS 1.2 as chosen protocol. Of course, this will only work with most recent versions of OpenSSL (see below).
Elliptic Curve Diffie-Hellman
ucspi-ssl supports the following curves from OpenSSL:
You can verify the ECC curves, your OpenSSL version offers with the following command:
Unlike DH with the Discrete Logarithm, there is no particular DHPRAM file to generate because the ECC parms are taken from internal defaults.
Further information about OpenSSL and it's usage can be found here:
OpenSSL dependencies and updates
Since ucspi-ssl depends on OpenSSL, it is inherently affected by bugs and flaws in here.
Thus, please check for
- Install the updated version of OpenSSL from you *NIX repository -- or --
- install OpenSSL from the source. Make sure to use the same path as your original installation. Typically, the required header files are expected in /usr/include/openssl.
- Check for your ucspi-ssl source directory; usually /package/host/superscript/net/ucspi-ssl-x.yz.
- Remove the directory ./compile and re-run package/install. This will link ucspi-ssl with the new OpenSSL version.
Note: Though ucspi-ssl did suffer from the Heartbleed bug in OpenSSL it is very unlikely that this could have exploited for security relevant information. sslserver in particular raises a new address space (and containing the vulnerable SSL context) for each new connection and IP. In this sense, sslserver mitigates your risks.
Note for MacOS X User
ucspi-ssl will compile with clang in case xcode is installed. You need to adjust conf-cc. The following include solved the situation under MacOS X 'El Capitan' in my case for conf-cc:
You can add that statement into the conf-cc file prior of compilation.
because MacOS X is missing the environ facility.
Note for RasPi/Raspian Linux
ucspi-tcp6 supports Raspian Linux and the ARM architecture out-of-the box.
Within the src directory of ucspi-ssl use
to display the given SW and HW architecture. Taking some compiler flags from gcc ARM options you can fine-tune settings to your ARM system within conf-cc and conf-ld.
Together with most Linux systems, you need to install the OpenSSL development environment. On a standard Debian system (like Raspian) you succeed with the following:
Enjoy the ucspi-ssl package!