No description
Find a file
2025-12-18 09:24:24 -07:00
.github ci: update and pin github actions 2025-12-18 23:43:25 +11:00
apps Fix inconsistencies in accept4.c 2025-08-28 13:42:04 +02:00
crypto include crypto/arch/aarch64/crypto_cpu_caps_windows.c 2025-10-28 07:06:00 -05:00
include compat/netinet/ip.h: add compat define for IPTOS_DSCP_VA 2025-12-18 08:42:32 -07:00
m4 move ftruncate to common libcompat for tests 2025-10-07 04:23:58 -05:00
man Update man links 2025-10-24 07:27:29 -06:00
patches refresh patches 2025-12-18 07:47:07 -07:00
scripts Do not remove opensslconf.h for android 2025-08-26 01:12:22 -06:00
ssl Land #1176, Automake: use relative paths when linking object lists 2025-06-06 00:03:26 -05:00
tests emscripten: avoid oom in clienttest 2025-12-18 09:24:24 -07:00
tls move ftruncate to common libcompat for tests 2025-10-07 04:23:58 -05:00
.gitignore Ignore ec_arithmetic test 2025-08-17 13:23:46 -06:00
appveyor.yml appveyor: store entire build folder in artifacts 2022-09-10 09:51:13 +05:00
autogen.sh -path isn't really needed for perms fixup, and not supported everywhere 2016-01-03 18:55:04 -06:00
ChangeLog Update ChangeLog 2025-10-24 13:49:16 +02:00
check-release.sh add top-level script copyright notices 2025-06-02 08:07:50 +07:00
cmake_export_symbol.cmake add copyright headers to Cmake files 2025-06-01 08:22:33 +07:00
cmake_uninstall.cmake.in add copyright headers to Cmake files 2025-06-01 08:22:33 +07:00
CMakeLists.txt automatically disable assembly on arm32 Darwin 2025-10-13 22:33:29 -05:00
config Add an OpenSSL compatible ./config wrapper 2014-10-31 07:35:06 -05:00
configure.ac Land #1175, Add ISC copyright headers, add explicit COPYING to LibreSSL portable tree 2025-06-03 05:08:04 -05:00
COPYING explicitly copy COPYING file in this project from LICENSE file in CVS tree 2025-06-01 08:22:33 +07:00
dist.sh add top-level script copyright notices 2025-06-02 08:07:50 +07:00
FindLibreSSL.cmake Added CMake hint when searching for LibreSSL directory on macOS 2024-11-29 17:39:10 -07:00
gen-coverage-report.sh add top-level script copyright notices 2025-06-02 08:07:50 +07:00
gen-openbsd-tags.sh add openbsd tag sync script + release verifier 2015-09-10 11:50:16 -05:00
libcrypto.pc.in add top-level script copyright notices 2025-06-02 08:07:50 +07:00
libressl.pub update public signify key 2020-04-09 08:29:34 -05:00
LibreSSLConfig.cmake.in Properly check components 2023-09-12 15:08:44 -04:00
libssl.pc.in add top-level script copyright notices 2025-06-02 08:07:50 +07:00
libtls.pc.in add top-level script copyright notices 2025-06-02 08:07:50 +07:00
Makefile.am add autotools build copyright headers 2025-06-01 08:22:33 +07:00
Makefile.am.common add autotools build copyright headers 2025-06-01 08:22:33 +07:00
OPENBSD_BRANCH Revert "Pin -portable to a commit before the endb64 addition" 2023-04-25 14:09:45 -06:00
openssl.pc.in add platform libraries to libcompat's LIBADD list 2014-07-12 03:34:08 -05:00
README.md add note about using emcmake with Emscripten in specific systems section 2024-06-20 21:29:18 +03:00
README.mingw.md Try to simplify build instruction. 2024-05-25 12:43:01 +02:00
update.sh Make opensslconf.h MI again 2025-08-26 00:55:50 -06:00

LibreSSL image

Official portable version of LibreSSL

Linux Build Status macOS Build Status Windows Build Status Android Build Status Solaris Build Status Fuzzing Status

LibreSSL is a fork of OpenSSL 1.0.1g developed by the OpenBSD project. Our goal is to modernize the codebase, improve security, and apply best practice development processes from OpenBSD.

Compatibility with OpenSSL

LibreSSL provides much of the OpenSSL 1.1 API. The OpenSSL 3 API is not currently supported. Incompatibilities between the projects exist and are unavoidable since both evolve with different goals and priorities. Important incompatibilities will be addressed if possible and as long as they are not too detrimental to LibreSSL's goals of simplicity, security and sanity. We do not add new features, ciphers and API without a solid reason and require that new code be clean and of high quality.

LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily earlier releases of LibreSSL. You will need to relink your programs to LibreSSL in order to use it, just as in moving between major versions of OpenSSL. LibreSSL's installed library version numbers are incremented to account for ABI and API changes.

Compatibility with other operating systems

While primarily developed on and taking advantage of APIs available on OpenBSD, the LibreSSL portable project attempts to provide working alternatives for other operating systems, and assists with improving OS-native implementations where possible.

At the time of this writing, LibreSSL is known to build and work on:

  • Linux (kernel 3.17 or later recommended)
  • FreeBSD (tested with 9.2 and later)
  • NetBSD (7.0 or later recommended)
  • HP-UX (11i)
  • Solaris 11 and later
  • Mac OS X (tested with 10.8 and later)
  • AIX (5.3 and later)
  • Emscripten (3.1.44 and later)

LibreSSL also supports the following Windows environments:

  • Microsoft Windows (Windows 7 / Windows Server 2008r2 or later, x86 and x64)
  • Wine (32-bit and 64-bit)
  • MinGW-w64, Cygwin, and Visual Studio

Official release tarballs are available at your friendly neighborhood OpenBSD mirror in directory LibreSSL, although we suggest that you use a mirror.

The LibreSSL portable build framework is also mirrored on GitHub.

Please report bugs either to the public libressl@openbsd.org mailing list, or to the GitHub issue tracker

Severe vulnerabilities or bugs requiring coordination with OpenSSL can be sent to the core team at libressl-security@openbsd.org.

Building LibreSSL

Building from a Git checkout

If you have checked out this source using Git, or have downloaded a source tarball from GitHub, follow these initial steps to prepare the source tree for building. Note: Your build will fail if you do not follow these instructions! If you cannot follow these instructions or cannot meet these prerequisites, please download an official release distribution from https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official releases is strongly advised if you are not a developer.

  1. Ensure that you have a bash shell. This is also required on Windows.
  2. Ensure that you have the following packages installed: automake, autoconf, git, libtool, perl.
  3. Run ./autogen.sh to prepare the source tree for building.

Build steps using configure

Once you have the source tree prepared, run these commands to build and install:

./configure   # see ./configure --help for configuration options
make check    # runs builtin unit tests
make install  # set DESTDIR= to install to an alternate location

Alternatively, it is possible to run ./dist.sh to prepare a tarball.

Build steps using CMake

Once you have the source tree prepared, run these commands to build and install:

mkdir build
cd build
cmake ..
make
make test

For faster builds, you can use Ninja:

mkdir build-ninja
cd build-ninja
cmake -G"Ninja" ..
ninja
ninja test

Or another supported build system like Visual Studio:

mkdir build-vs2022
cd build-vs2022
cmake -G"Visual Studio 17 2022" ..

Additional CMake Options

Option Name Default Description
LIBRESSL_SKIP_INSTALL OFF allows skipping install() rules. Can be specified from command line using
-DLIBRESSL_SKIP_INSTALL=ON
LIBRESSL_APPS ON allows skipping application builds. Apps are required to run tests
LIBRESSL_TESTS ON allows skipping of tests. Tests are only available in static builds
BUILD_SHARED_LIBS OFF CMake option for building shared libraries.
ENABLE_ASM ON builds assembly optimized rules.
ENABLE_EXTRATESTS OFF Enable extra tests that may be unreliable on some platforms
ENABLE_NC OFF Enable installing TLS-enabled nc(1)
OPENSSLDIR Blank Set the default openssl directory. Can be specified from command line using
-DOPENSSLDIR=<dirname>

Build information for specific systems

HP-UX (11i)

Set the UNIX_STD environment variable to 2003 before running configure in order to build with the HP C/aC++ compiler. See the "standards(5)" man page for more details.

export UNIX_STD=2003
./configure
make

MinGW-w64 - Windows

LibreSSL builds against relatively recent versions of MinGW-w64, not to be confused with the original mingw.org project. MinGW-w64 3.2 or later should work. See README.mingw.md for more information.

Emscripten

When configuring LibreSSL for use with Emscripten, make sure to prepend emcmake to your cmake configuration command. Once configured, you can proceed with your usual cmake commands. For example:

emcmake cmake . -Bbuild
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

Using LibreSSL

CMake

Make a new folder in your project root (where your main CMakeLists.txt file is located) called CMake. Copy the FindLibreSSL.cmake file to that folder, and add the following line to your main CMakeLists.txt:

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")

After your add_executable or add_library line in your CMakeLists.txt file add the following:

find_package(LibreSSL REQUIRED)

It will tell CMake to find LibreSSL and if found will let you use the following 3 interfaces in your CMakeLists.txt file:

  • LibreSSL::Crypto
  • LibreSSL::SSL
  • LibreSSL::TLS

If you for example want to use the LibreSSL TLS library in your test program, include it like so (SSL and Crypto are required by TLS and included automatically too):

target_link_libraries(test LibreSSL::TLS)

Full example:

cmake_minimum_required(VERSION 3.10.0)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")

project(test)

add_executable(test Main.cpp)

find_package(LibreSSL REQUIRED)

target_link_libraries(test LibreSSL::TLS)

Linux

Following the guide in the sections above to compile LibreSSL using make and running sudo make install will install LibreSSL to the /usr/local/ folder, and will be found automatically by find_package. If your system installs it to another location, or you have placed them yourself in a different location, you can set the CMake variable LIBRESSL_ROOT_DIR to the correct path, to help CMake find the library.

Windows

Placing the library files in C:/Program Files/LibreSSL/lib and the include files in C:/Program Files/LibreSSL/include should let CMake find them automatically, but it is recommended that you use CMake-GUI to set the paths. It is more convenient as you can have the files in any folder you choose.