Skip to content

native-image does not populate GSS Oid mechanisms #4700

@avimalka

Description

@avimalka

When building with native-image GSSManager does not detect any Oid .
It seems like GSSManager does not have any Provider populated at all.

How to reproduce:
Sample.java

import org.ietf.jgss.*;

public class Sample {
  public static void main(String[] args) throws org.ietf.jgss.GSSException {
  GSSManager gssManager = GSSManager.getInstance();
  gssManager.createName("AAA", GSSName.NT_USER_NAME);
  }
}

javac Sample.java
java -agentlib:native-image-agent=config-output-dir=META-INF/native-image Sample
native-image --no-fallback Sample

Tested with:
GraalVM CE 22.1.0 Java 17

Stacktrace (for the native executable)
Exception in thread "main" GSSException: Unsupported mechanism requested: 1.2.840.113554.1.2.2
at sun.security.jgss.ProviderList.getMechFactory(ProviderList.java:199)
at sun.security.jgss.ProviderList.getMechFactory(ProviderList.java:166)
at sun.security.jgss.GSSManagerImpl.getNameElement(GSSManagerImpl.java:183)
at sun.security.jgss.GSSNameImpl.getElement(GSSNameImpl.java:469)
at sun.security.jgss.GSSNameImpl.init(GSSNameImpl.java:202)
at sun.security.jgss.GSSNameImpl.(GSSNameImpl.java:171)
at sun.security.jgss.GSSNameImpl.(GSSNameImpl.java:152)
at sun.security.jgss.GSSManagerImpl.createName(GSSManagerImpl.java:109)
at Sample.main(Sample.java:6)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions