Consulting djbware Publications

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

ucspi-ssl can be considered as high-level programming interface for OpenSSL and LibreSSL which is mandatory to achieve TLS support for

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.7 TLS 1.3 enabled version of ucspi-ssl requiring fehQlibs-10 MD5: bbe4e8e44565dea05525d4d1f6176290
Build: 20181110210750
ucspi-ssl 0.10.6 TLS 1.3 enabled version of ucspi-ssl depending on fehQlibs MD5: 9bb2a08d5e18434f20e75fefc5f8425c
Build: 20181013145804
ucspi-ssl 0.99e IPv6 enabled ucspi-ssl supporting OpenSSL 1.1 together with LibreSSL MD5: d6d1269606834f0e1a3cfd28c142fb36
Build: 20180711223427

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/<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

Man pages:

Server apps Client apps Miscellaneous
sslserver https@

Source code:

The source code of the current ucspi-ssl is provided as Doxygen documentation.


General information

Translations (outdated):

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:

2018-10-12 13:02:14 sslserver: tls 16518 accept TLSv1.3:TLS_AES_256_GCM_SHA384 2018-10-12 13:02:19 qmail-smtpd: pid 16518 Reject::AUTH::login P:ESMTPSA S: H:User ?~ '' 2018-10-12 13:02:19 sslserver: ended by 16513 status 0 2018-10-12 13:11:40 sslserver: tls 17356 accept TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305 2018-10-12 13:11:41 qmail-smtpd: pid 17356 Accept::RCPT::Recipients_Pam P:ESMTPS ... 2018-10-12 13:11:55 sslserver: ended by 17351 status 0

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

TLS 1.3 with OpenSSL 1.1.1

TLS 1.3 is a very different protocol in comparison with it's predecessors,

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:

You can verify the ECC curves, your OpenSSL version offers with the following command:

openssl ecparam -list_curves

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 CVEs. In case you need to upgrade the *SSL libs, proceed as follows:

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:

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

Checking your installation

Once installed, your TLS (1.3) capabilities can be checked using this nice script from Dirk Wetter.

*ix specific installation instructions


Gentoo includes a ready-to-use package for ucspi-ssl. However, this package is outdated.


NetBSD includes the ucspi-ssl package (outdated).


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:

clang -O2 -g -Wall -I /Developer/SDKs/MacOSX10.6.sdk/usr/include

You can add that statement into the conf-cc file prior of compilation.

Continue with:

package/compile base

because MacOS X is missing the environ facility.

OmniOS (Illumos)

The usual loader option -m64 does not work and is erroneously detected. After package/compile edit within the compile directory the file load and remove that option. Issue the command make as usual.

Since manpath is not supported, you need to include the man-path manually in conf-man.

Proceed with package/install.

RasPi/Raspian Linux

ucspi-ssl supports Raspian Linux and the ARM architecture out-of-the box.

Within the src directory of ucspi-ssl use

sh ./

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:

agt-get update apt-get install libssl-dev

Enjoy the ucspi-ssl package!