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

Make the lookup for getApplicationProtocol optional #53001

Merged
merged 2 commits into from
May 20, 2021

Conversation

steveisok
Copy link
Member

@steveisok steveisok commented May 19, 2021

The method getApplicationProtocol in javax.net.ssl.SSLEngine is only supported on API level 29 and above, so running on older devices would result in a crash.

This change makes the initial method lookup optional and AndroidCryptoNative_SSLStreamGetApplicationProtocol in pal_sslstream.c will error if it is not supported.

Fixes #52965

The method getApplicationProtocol in javax.net.ssl.SSLEngine is only supported on API level 29 and above, so running on older devices would result in a crash. This change makes the initial method lookup optional and AndroidCryptoNative_SSLStreamGetApplicationProtocol in pal_sslstream.c will error if it is not supported.

Fixes dotnet#52965
@ghost
Copy link

ghost commented May 19, 2021

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks
See info in area-owners.md if you want to be subscribed.

Issue Details

The method getApplicationProtocol in javax.net.ssl.SSLEngine is only supported on API level 29 and above, so running on older devices would result in a crash.

This change makes the initial method lookup optional and AndroidCryptoNative_SSLStreamGetApplicationProtocol in pal_sslstream.c will error if it is not supported.

Fixes #52965

Author: steveisok
Assignees: -
Labels:

area-System.Security

Milestone: -

@akoeplinger akoeplinger merged commit 28c213f into dotnet:main May 20, 2021
@steveisok
Copy link
Member Author

@akoeplinger Do you think we should backport this?

@akoeplinger akoeplinger deleted the fix-droid-method branch May 21, 2021 09:05
@akoeplinger
Copy link
Member

Yes because otherwise Xamarin Android applications won't run on API<29 in preview5.

@akoeplinger
Copy link
Member

/backport to release/6.0-preview5

@github-actions
Copy link
Contributor

Started backporting to release/6.0-preview5: https://github.com/dotnet/runtime/actions/runs/863314657

@ghost ghost locked as resolved and limited conversation to collaborators Jun 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android JNI trying to get SSLEngine.getApplicationProtocol but it was introduced in API 29
3 participants