← Back to section · Tutorials & Labs

Building OpenSSL 3.5 from Source: Isolated Installation and Verification Steps

When your distribution's repositories do not yet carry OpenSSL 3.5, building from source is the reliable path to native ML-KEM. This article covers the prerequisites, the Configure options that matter, isolated installation and post-build verification — without polluting the system libraries.

Published 22 November 2026 · 6 min read · PQ Frontier

Building OpenSSL 3.5 from Source: Isolated Installation and Verification Steps
AI-generated site artwork
Video explainer · OpenSSL practice: command line and API

Why build it yourself? The most common reason is the version: many distributions’ stable repositories are still on OpenSSL 3.0, while native ML-KEM, ML-DSA and SLH-DSA require 3.5 (released in April 2025). Building a 3.5 from source on a lab machine is a perfectly legitimate and controllable path — provided you respect the isolation principle and do not break the system.

Prerequisites and Obtaining the Source

The build needs three things: a C compiler (gcc or clang), make, and Perl 5 (the Configure script itself is written in Perl; without Perl you cannot take the first step). Obtain the source only from openssl.org’s official release page or its official GitHub repository, and after downloading, verify the SHA256 checksum published on the release page before extracting — this is cryptographic software, and source verification is not a formality. After extracting, work from the root of the source tree; all subsequent commands run there.

Configure: Think the Options Through Once

./Configure --prefix=/opt/openssl-3.5 --openssldir=/opt/openssl-3.5/ssl
# append this if you need the FIPS provider: enable-fips
make -j"$(nproc)"

--prefix is the core of the isolation: it installs the binaries, libraries, headers and modules into the single self-contained tree /opt/openssl-3.5, completely separate from the system’s copy; --openssldir gives it its own configuration directory so it does not read the system openssl.cnf and cross-contaminate behaviour. Feature options must also be settled at this stage: enable-fips decides whether the FIPS provider is built (leave it off unless you have a compliance scenario — switching it on also commits you to the fipsinstall flow); trimming options such as no-legacy follow the same logic. The build system is “configure once, applies to everything”: if you discover a missing feature after installation, the only remedy is to change the options and rebuild — there is no runtime top-up. For lab use, keeping the default feature surface and adding only the prefix isolation is the steadiest choice.

Testing and Installation

make test          # the full suite takes a while; a subset is possible when in a hurry, see below
make install

make test runs OpenSSL’s complete bundled test suite and can take a long time on a slow machine; when pressed for time you can run only the subsets relevant to the new features, for example with an invocation of the form make TESTS=test_evp_extra test (test names are those actually present in the source’s test/ directory). But weigh the trade-off: the full suite is the strongest evidence that the build is correct, so let it run to completion when the lab machine’s time allows. After make install, the new executable lives at /opt/openssl-3.5/bin/openssl.

Verification: Three Gates, All Must Pass

Whether the build succeeded is not judged by the absence of compile errors, but by these three gates:

/opt/openssl-3.5/bin/openssl version -a
ldd /opt/openssl-3.5/bin/openssl | grep -E "ssl|crypto"
/opt/openssl-3.5/bin/openssl list -kem-algorithms | grep -i ml-kem

Gate one: the version must be 3.5.x, and OPENSSLDIR and MODULESDIR must both point into the new tree. Gate two is the critical one: in the ldd output, libssl and libcrypto must resolve under /opt/openssl-3.5/lib (or lib64), not the system’s /usr/lib — a new binary linked against old libraries is the classic half-finished state of a source install, and its symptom is a correct version with the new algorithms missing. When this happens, the runtime library search path has usually been pre-empted by the system paths; fix it by setting LD_LIBRARY_PATH=/opt/openssl-3.5/lib explicitly, or by baking the path into the binary at Configure time with -Wl,-rpath,/opt/openssl-3.5/lib. Gate three: the three ML-KEM parameter sets appear in the KEM list, and only then has the new feature surface actually landed. Use the full path for all experiments with it, too, and do not push the new directory ahead of the system PATH where it would affect other programs.

Supplement: Decisions Before and After the Build

Release tarball or git repository? Experiments and production alike should use the official release archive (such as openssl-3.5.x.tar.gz): it ships the complete generated Configure machinery and checksums. The git repository’s development branches need extra generation steps and correspond to no released version; they are for people developing OpenSSL itself. Shared or static libraries? The default build produces shared libraries, which is the form this article’s verification flow assumes; no-shared links the libraries statically into the binary, which makes the ldd gate uncheckable and means every security patch to the library requires rebuilding all programs — unnecessary for lab purposes. Parallelism and time expectations. With make -j using all cores, building 3.5 on an ordinary machine takes on the order of minutes, while a full make test can take several times longer; budget the time generously and do not interrupt a test run halfway on suspicion of a hang — test output stalling on one case usually means that case is itself slow (large-parameter RSA generation, for example), so check whether the process is still consuming CPU before deciding.

Should you keep the build tree? Our advice is to keep the source directory as it is: if you later want to add or drop a Configure option or patch the same version, reconfiguring in the original tree is the steadiest path. make clean removes intermediate products but not the configuration; for a complete rollback, delete the /opt/openssl-3.5 installation tree and the source directory — the system’s own copy was never touched and needs no repair. One boundary to draw clearly: a self-built OpenSSL does not follow the distribution’s security updates. That is fine on a lab machine, but if a service runs on a self-built version long-term, someone must watch the official security advisories and rebuild promptly — that maintenance duty is part of what you accept when you choose to build from source, and it belongs in the evaluation.

Once installed, the experiment workflow aligns exactly with the system version: the list inventory, genpkey generation and pkeyutl encapsulation commands from the earlier articles work verbatim with the binary path replaced by /opt/openssl-3.5/bin/openssl. Fix that full path in a small script or alias in your lab directory, so you do not forget to swap it when typing and end up comparing outputs from the old and new versions side by side — inventory baselines in particular should record which binary produced each output, since version confusion is exactly what gate two of the verification exists to prevent. If, after the experiments, you want to roll the self-built version out to several machines, the right approach is to build on one machine and distribute the whole installation tree, rather than recompiling machine by machine: the Configure options and test conclusions carry over completely, and each target machine only needs the ldd and list gates from the verification section as landing checks.

One more detail: build logs are worth keeping. Archive the complete Configure command line and the make test conclusion alongside the installation tree; six months later, when you need to reproduce the same build or report a problem to the community, those two artefacts save a great deal of recall and trial and error. The reproducibility of a lab environment often lives in exactly these unglamorous records.

Summary

The whole craft of building from source is: verify the source, install isolated via Configure, verify the linkage with ldd, and verify the features with list. With 3.5 living in its own directory alongside the system version, experiments can be as rough as you like, and if something goes wrong, deleting the whole tree rolls back cleanly — which is exactly why it is so much safer than upgrading the system libraries in place.

Tags: OpenSSLsource buildConfigurelab environment