Skip to content

make sure OpenSSL is initialized before Tls13Supported code runs - #62973

Merged
wfurt merged 4 commits into
dotnet:mainfrom
wfurt:Tls13Supported_61891
Jan 4, 2022
Merged

make sure OpenSSL is initialized before Tls13Supported code runs#62973
wfurt merged 4 commits into
dotnet:mainfrom
wfurt:Tls13Supported_61891

Conversation

@wfurt

Copy link
Copy Markdown
Member

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))
staticvoidInitializeOpenSSLShim()

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.

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

Copy link
Copy Markdown

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))
staticvoidInitializeOpenSSLShim()

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:mainJan 4, 2022
@wfurt
wfurt deleted the Tls13Supported_61891 branch January 4, 2022 00:37
@wfurt

wfurt commented Jan 4, 2022

Copy link
Copy Markdown
MemberAuthor

/backport to release/6.0

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

@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!

@karelzkarelz added this to the 7.0.0 milestone Jan 25, 2022
@ghostghost locked as resolved and limited conversation to collaborators Feb 25, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net.Securityos-linuxLinux 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

@wfurt@stephentoub@jkotas@karelz