Skip to content

make sure OpenSSL is initialized before Tls13Supported code runs #62973

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

Merged
merged 4 commits into from
Jan 4, 2022

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Dec 17, 2021

replacement for #62037

This is regression caused by #46640. Tls13Supported can be called before static constructor runs. It was OK in 5.0 since the OpenSSL library was initialized via

__attribute__((constructor))
static void InitializeOpenSSLShim()

With 6.0, it will be initialized when Ssl us
used but some properties like CiphersSuitePolicy can be used before in order to prepare everything needed.

fixes #61891.

@wfurt wfurt added area-System.Net.Security os-linux Linux OS (any supported distro) labels Dec 17, 2021
@wfurt wfurt requested review from stephentoub, bartonjs and a team December 17, 2021 21:12
@wfurt wfurt self-assigned this Dec 17, 2021
@ghost
Copy link

ghost commented Dec 17, 2021

Tagging subscribers to this area: @dotnet/ncl, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

replacement for #62037

This is regression caused by #46640. Tls13Supported can be called before static constructor runs. It was OK in 5.0 since the OpenSSL library was initialized via

__attribute__((constructor))
static void InitializeOpenSSLShim()

With 6.0, it will be initialized when Ssl us
used but some properties like CiphersSuitePolicy can be used before in order to prepare everything needed.

fixes #61891.

Author: wfurt
Assignees: wfurt
Labels:

area-System.Net.Security, os-linux

Milestone: -

…aphy.Native/Interop.Ssl.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
@wfurt wfurt merged commit a76387e into dotnet:main Jan 4, 2022
@wfurt wfurt deleted the Tls13Supported_61891 branch January 4, 2022 00:37
@wfurt
Copy link
Member Author

wfurt commented Jan 4, 2022

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1655706648

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

@wfurt backporting to release/6.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: make sure OpenSSL is initialized before Tls13Supported code runs
Using index info to reconstruct a base tree...
M	src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
M	src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
CONFLICT (content): Merge conflict in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
Auto-merging src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
CONFLICT (content): Merge conflict in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 make sure OpenSSL is initialized before Tls13Supported code runs
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@karelz karelz added this to the 7.0.0 milestone Jan 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Security os-linux Linux OS (any supported distro)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CipherSuitesPolicy constructor throws PlatformNotSupportedException on Linux with OpenSSL 1.1.1
4 participants