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.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.
- The current ucspi-ssl-0.99 also includes fixes for OpenSSL 1.1 API changes and works fine under Debian (9) 'Stretch'.
- Version 0.99b is a convenience release to support clang in addition with gcc.
- Version 0.99c fixes a cosmetic bug in sslserver to display the parent PID instead of the child's in the log.
- Version 0.99d is just a cosmetic release, indicating the parent PID in the logs while closing the TLS connection.
- Version 0.99e fixes a bug in ssl_params.c not returning '0' for ECDH options.
- Version 0.10 is a complete redesign based on fehQlibs providing much better IPv6 compatibility and should be used together with ucspi-tcp6-1.10 in particular to build the tcprules database.
- ucspi-ssl-0.10.x is TLS 1.3 enabled supporting OpenSSL 1.1.1.
This is facilitated by means of the lib ucspissl.a (after compilation; located in ./compile) and the header file ucspissl.h.
|Version & Download||Description||Verification|
|ucspi-ssl 0.10.6||TLS 1.3 enabled version of ucspi-ssl depending on fehQlibs||MD5: 9bb2a08d5e18434f20e75fefc5f8425c
|ucspi-ssl 0.99e||IPv6 enabled ucspi-ssl supporting OpenSSL 1.1 together with LibreSSL|| MD5: d6d1269606834f0e1a3cfd28c142fb36
The source code of the current ucspi-ssl is provided as Doxygen documentation.
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.
Documentation of the programs
|Server apps||Client apps||Miscellaneous|
The source code of the current ucspi-ssl is provided as Doxygen documentation.
- Required: fehQlibs
- Optional but indispensible: ucspi-tcp6 to build the cdb to control incoming connections for sslserver using tcprules coming 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 (outdated).
- The original ucspi-ssl source created by W.E. Baxter.
- Scott Gifford's STARTTLS UCPSI-SSL extension (unavailable).
- 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:
In the first case AES_256_GCM_SHA384 is the negotiated Cipher in use together
with TLS 1.3 as chosen protocol, which requires ECDH as key exchange protocol.
In the second case, TLS 1.2 is used but now with the most recent CHACHA20-POLY1305 stream cipher+authentication provided by Dan Bernstein.
Of course, this will only work with most recent versions of OpenSSL (see below), which - as can be seen - is also availalbe for unwanted visitors from the Seychelles (using IP 188.8.131.52).
TLS 1.3 with OpenSSL 1.1.1
TLS 1.3 is a very different protocol in comparison with it's predecessors,
- protecting large parts of the handshake material, in particular the X.509 certificates,
- providing by the same token a much faster handshake,
- using D.J. Bernstein's ChaCha20 and Poly1305 for message encryption and authentication based on the AEAD model instead of AES in broken CBC-mode and with awful hashsums (hash-then-encrypt),
- while requiring for the handshake to be always ephemeral Diffie-Hellman (ECDHE) based on Elliptic Curves.
In short, TLS 1.3 is 21st century cryptography.
Elliptic Curve Diffie-Hellman
ucspi-ssl may use one of the following curves from OpenSSL 1.1.1:
- x25519 (the Bernstein Curve)
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:
*SSL dependencies and updates
Since ucspi-ssl depends on either OpenSSL or LibreSSL,
it is inherently affected by bugs and flaws in here.
Thus, please check for
- Install the updated version of *SSL from you *NIX repository -- or --
- install *SSL 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 *SSL 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.
The latest version of ucspi-ssl support:
- OpenSSL 0.98, 0.99,
- OpenSSL 1.0, and now
- OpenSSL 1.1 (eg. on Debian 'Stretch' and Arch Linux with OpenSSL-1.1.0.f-2), as well as
- OpenSSL 1.1.1
- LibreSSSL is covered and working for OpenBSD 6.0.
Under normal circumstances, ucspi-ssl detects the respective *SSL versions and will compile and work without manual intervention.
However, you may use the most current OpenSSL (and LibreSSL) versions on your system in a 'none-destructive' mode for ucspi-ssl while adjusting
- conf-ssl including the path to header files and
- conf-ssllibs using the argument -L for determine the path of the libraries 'libssl' and 'libcrypto'.
Checking your installation
Once installed, your TLS (1.3) capabilities can be checked using this nice testssl.sh script from Dirk Wetter.
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 Gentoo Users
Gentoo includes a ready-to-use package for ucspi-ssl.
Note for RasPi/Raspian Linux
ucspi-ssl 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!