Skip to content

Android JNI trying to get SSLEngine.getApplicationProtocol but it was introduced in API 29 #52965

Closed
@akoeplinger

Description

@akoeplinger

Found this while looking at why a workitem crashed and saw we were running on an Android 28 device (https://github.com/dotnet/core-eng/issues/13102).

The implementation tries to access the method even though it was only introduced in API 29: https://developer.android.com/reference/javax/net/ssl/SSLEngine#getApplicationProtocol()

g_SSLEngineGetApplicationProtocol = GetMethod(env, false, g_SSLEngine, "getApplicationProtocol", "()Ljava/lang/String;");

We should update the implementation to use GetOptionalMethod instead and handle the missing API case appropriately.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions