Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCORE-2196 Use the Windows trusted root certificates for TLS #7882

Merged
merged 7 commits into from
Jul 15, 2024

Conversation

fealebenpae
Copy link
Member

@fealebenpae fealebenpae commented Jul 11, 2024

What, How & Why?

If an app runs in an enterprise environment where the machine is configured with a traffic-intercepting firewall any custom SSL certificates issued by the firewall need a new trusted root certificate to be installed on the machine. The interface we currently expose puts the onus on the app developer to provide us with a certificate we can add to the OpenSSL certificate store, but in such an environment the app developer is not able to do so.
What we can do to better conform is to automatically look up certificates in the machine's Trusted Root Certification Authorities store on OpenSSL's behalf and use them for the SSL handshake.

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)

@fealebenpae fealebenpae self-assigned this Jul 11, 2024
@cla-bot cla-bot bot added the cla: yes label Jul 11, 2024
Copy link

coveralls-official bot commented Jul 11, 2024

Pull Request Test Coverage Report for Build yavor.georgiev_443

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 97 unchanged lines in 13 files lost coverage.
  • Overall coverage decreased (-0.03%) to 90.977%

Files with Coverage Reduction New Missed Lines %
src/realm/index_string.hpp 1 93.48%
src/realm/util/serializer.cpp 1 90.43%
test/test_index_string.cpp 1 93.48%
src/realm/array_blobs_big.cpp 2 98.58%
src/realm/object-store/shared_realm.cpp 2 91.89%
src/realm/sync/network/http.hpp 2 83.25%
test/test_lang_bind_helper.cpp 2 93.2%
src/realm/sync/noinst/client_impl_base.cpp 3 81.99%
src/realm/table.cpp 4 90.42%
src/realm/bplustree.cpp 7 71.41%
Totals Coverage Status
Change from base Build 2483: -0.03%
Covered Lines: 215223
Relevant Lines: 236569

💛 - Coveralls

@@ -131,6 +131,8 @@ class Context {
/// default certificates for server verification. For OpenSSL,
/// use_default_verify() corresponds to
/// SSL_CTX_set_default_verify_paths(SSL_CTX*);
///
/// On Windows this also adds a lookup to the system Trusted Root Certification Authorities list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to know if it failed to find certs for whatever reason so that you could fall back to m_ssl_context.use_included_certificate_roots();?

Copy link
Member Author

Choose a reason for hiding this comment

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

The use_ methods are not mutually-exclusive. You can call as many as you like while you’re setting up your context.
Besides, looking up certificates happens during the SSL handshake, way after you’ve set up the context.

@fealebenpae fealebenpae merged commit fac06bf into master Jul 15, 2024
4 of 5 checks passed
@fealebenpae fealebenpae deleted the yg/openssl-native-ca branch July 15, 2024 14:10
@github-actions github-actions bot mentioned this pull request Jul 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants