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

Fix tls pool #4910

Merged
merged 3 commits into from
Jul 22, 2024
Merged

Fix tls pool #4910

merged 3 commits into from
Jul 22, 2024

Conversation

FenrirUnbound
Copy link
Contributor

@FenrirUnbound FenrirUnbound commented Jul 21, 2024

Addresses #4795. Apologies in advance for my poor rust competency.

This patch moves the rustls invocation into src/main.rs for the default provider to load without error.

From the suggestions in the rustls documentation, this patch follows the guidance described in the 2nd bullet point:

The intention is that an application can specify the CryptoProvider they wish to use once, and have that apply to the variety of places where their application does TLS (which may be wrapped inside other libraries). They should do this by calling CryptoProvider::install_default() early on.

To achieve this goal:

This call is positioned in src/main.rs because it needs to happen before pict-rs, which installs the provider if it's not set: source code reference.

FWIW, doing a similar tactic of "ignore the error" also works, but the nuances with making that choice are beyond my current understanding of the code base.

@FenrirUnbound FenrirUnbound marked this pull request as ready for review July 21, 2024 06:51
@FenrirUnbound FenrirUnbound requested a review from dessalines July 21, 2024 17:57
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

Sweet, thx!

@dessalines dessalines merged commit 3d80ac2 into LemmyNet:main Jul 22, 2024
1 check passed
Nutomic pushed a commit to sunaurus/lemmy that referenced this pull request Sep 20, 2024
* Cargo: add rustls as a dependency

* install tls provider in main

* Cargo: re-define rustls dependency
@urda
Copy link

urda commented Oct 13, 2024

So I think I was "impacted" by this during my upgrade to 0.19.5 from 0.19.3 I had sslmode set to require but after the upgrade I had to set it to prefer in my lemmy config.

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.

4 participants