Skip to content

Comments

Added support for custom OpenSSL selection#5799

Open
toxicteddy00077 wants to merge 1 commit intomicrosoft:mainfrom
toxicteddy00077:add-openssl-version-support
Open

Added support for custom OpenSSL selection#5799
toxicteddy00077 wants to merge 1 commit intomicrosoft:mainfrom
toxicteddy00077:add-openssl-version-support

Conversation

@toxicteddy00077
Copy link

Closes #5614

Added support for choosing custom OpenSSL version with three prospective methods:

  1. Use submodule
  2. Use OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR variables
  3. Use find_package

I mostly built on the suggestion given by the issue author

@toxicteddy00077 toxicteddy00077 requested a review from a team as a code owner February 18, 2026 18:29
@toxicteddy00077
Copy link
Author

@microsoft-github-policy-service agree

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.78%. Comparing base (3f1d8ec) to head (f64c75a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5799      +/-   ##
==========================================
- Coverage   86.34%   84.78%   -1.56%     
==========================================
  Files          60       60              
  Lines       18729    18729              
==========================================
- Hits        16172    15880     -292     
- Misses       2557     2849     +292     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@guhetier guhetier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.
I don't think we can use the find_package approach with QuicTLS.

Our longer term goal is to stop depending on QuicTLS completely (once OpenSSL 3.5 is broadly available), so we could also add these new build config work only for openssl, not quictls.

CMakeLists.txt Outdated
add_library(OpenSSL INTERFACE)

include(FetchContent)
option(QUIC_USE_EXTERNAL_OPENSSL "Use external OpenSSL instead of building from submodules" OFF)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please declare these parameters with the others at the top of the file, so they are easy to find.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

endif()
target_link_libraries(OpenSSLQuic INTERFACE OpenSSL::SSL OpenSSL::Crypto)
endif()
add_library(OpenSSLQuic::OpenSSLQuic ALIAS OpenSSLQuic)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a different name for the alias, and aliasing OpenSSLQuic::OpenSSLQuic to that name too.
I find it somewhat confusing as it is (unless this is a common Cmake pattern, I am not fluent in Cmake)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't say im sure about the naming convention either but for the sake of brevity ive kept it as OpenSSL::MsQuic


if(QUIC_USE_EXTERNAL_OPENSSL OR QUIC_OPENSSL_INCLUDE_DIR OR QUIC_OPENSSL_LIB_DIR)
add_library(OpenSSLQuic INTERFACE)
if(QUIC_OPENSSL_INCLUDE_DIR AND QUIC_OPENSSL_LIB_DIR)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only one of the two is set, we will go through the else path.
We should have an error instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

CMakeLists.txt Outdated
if(QUIC_TLS_LIB STREQUAL "openssl")
find_package(OpenSSL 3.5.0 REQUIRED)
else()
find_package(OpenSSL REQUIRED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the TLS provider is quictls, we need to link QuicTLS version of libssl statically.
It is a fork of OpenSSL with support for QUIC, OpenSSL prior to 3.5 doesn't expose the required APIs, so dynamically linking to the system libssl won't work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright ive added a condition for this

@toxicteddy00077 toxicteddy00077 force-pushed the add-openssl-version-support branch from f64c75a to 12ead5d Compare February 19, 2026 10:01
@guhetier guhetier enabled auto-merge (squash) February 19, 2026 18:48
@guhetier guhetier disabled auto-merge February 19, 2026 18:48
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.

Allow to use custom OpenSSL version

2 participants