Skip to content

Improve support for custom OpenSSL selection#5848

Open
masa-koz wants to merge 1 commit intomicrosoft:mainfrom
masa-koz:masa-koz/custom-openssl
Open

Improve support for custom OpenSSL selection#5848
masa-koz wants to merge 1 commit intomicrosoft:mainfrom
masa-koz:masa-koz/custom-openssl

Conversation

@masa-koz
Copy link
Contributor

@masa-koz masa-koz commented Mar 7, 2026

Description

This pull request improves support for using external OpenSSL installations with the build system, especially for static and shared library builds. It introduces a new Cargo feature, better environment variable handling, and more robust CMake logic for finding and linking OpenSSL. The changes are grouped by theme below.

Build system improvements for external OpenSSL:

  • Added a new openssl-external Cargo feature to enable building with an external OpenSSL installation. (Cargo.toml Cargo.tomlR93)
  • Updated the Rust build script (scripts/build.rs) to handle the new feature, passing appropriate CMake definitions and reading OpenSSL paths from environment variables (OPENSSL_DIR, OPENSSL_INCLUDE_DIR, OPENSSL_LIB_DIR). (scripts/build.rs scripts/build.rsR51-R64)
  • Changed the output directory for the native MsQuic library in the build script to use an artifacts subdirectory for better organization. (scripts/build.rs scripts/build.rsL32-R32)

CMake configuration enhancements:

  • Added a QUIC_OPENSSL_DIR CMake cache variable to specify the path to an OpenSSL installation, complementing the existing include and lib directory options. (CMakeLists.txt CMakeLists.txtR115)
  • Improved CMake logic for finding and linking OpenSSL libraries: now distinguishes between static and shared builds, uses the correct library suffix, and avoids duplicate dependency linking by only linking the main OpenSSL libraries at this stage. (CMakeLists.txt CMakeLists.txtR776-R807)

Testing

No

Documentation

TBD

@masa-koz masa-koz requested a review from a team as a code owner March 7, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant