[Android] Fix crash in startup when running below API Level 24 (#54231)
authorSteve Pfister <steveisok@users.noreply.github.com>
Tue, 15 Jun 2021 20:38:44 +0000 (16:38 -0400)
committerGitHub <noreply@github.com>
Tue, 15 Jun 2021 20:38:44 +0000 (16:38 -0400)
commit337216a96c10cea1df62af25a49c74e378540cc4
treefcd356245b9f57e9c0368599cb71b6b9c28c07a3
parent2506a7423d59a09c17a6b4d766845bd1b64aa11a
[Android] Fix crash in startup when running below API Level 24 (#54231)

This change fixes a crash when running below API Level 24 due to SNIHostName and SSLParameters.setServerNames not being available. We will now throw a PlatformNotSupportedException to make things a little more apparent.

Fixes #54182
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_jni.c
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_jni.h
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_sslstream.c
src/libraries/System.Net.Security/src/Resources/Strings.resx