Skip to content

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 ghost added the area-System.Security label May 19, 2021
@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: -

@steveisok steveisok requested a review from akoeplinger May 19, 2021 23:42
@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