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

SunX509 KeyManagerFactory not available - running IBM JVM #2

Closed
ghost opened this issue Mar 2, 2018 · 1 comment
Closed

SunX509 KeyManagerFactory not available - running IBM JVM #2

ghost opened this issue Mar 2, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 2, 2018

I have implemented the code for Composite-JKS as described for my java client. I used Maven to add the dependency and added the SslContextUtils.mergeWithSystem(getClass().getClassLoader().getResourceAsStream("trust.jks")); statement to my java client. When I execute this statement, I receive the following error:

java.security.NoSuchAlgorithmException: SunX509 KeyManagerFactory not available
at sun.security.jca.GetInstance.getInstance(GetInstance.java:171)
at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:12)
at com.oneandone.compositejks.SslContextUtils.getSystemKeyManager(SslContextUtils.java:85)
at com.oneandone.compositejks.SslContextUtils.buildMergedWithSystem(SslContextUtils.java:71)
at com.oneandone.compositejks.SslContextUtils.mergeWithSystem(SslContextUtils.java:27)
at com.oneandone.compositejks.SslContextUtils.mergeWithSystem(SslContextUtils.java:41)
at com.ibm.zss.client.boundary.ZssAPIResource.(ZssAPIResource.java:43)
at com.ibm.zss.client.boundary.ZssAPIService.(ZssAPIService.java:38)
at com.ibm.zss.client.ZssAPIServiceTest.setUpBeforeClass(ZssAPIServiceTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

I found similar issues for other projects which indicate that the problem is that the SunX509 KeyManagerFactory is not available on a system running the IBM JVM. The solution was to allow the algorithm to be configurable. (See https://code.google.com/archive/p/javapns/issues/39 and https://code.google.com/archive/p/javapns/issues/41)

Is this option already configurable for CompositeJKS or can you add this support?

@bastianeicher
Copy link
Collaborator

Thanks for reporting this issue.

I have introduced a new static field SslContextUtils.X509Algorithm in commit 6e5314d. It defaults to SunX509 but can be overriden for use on other JVMs.

I will create a new release of CompositeJKS that includes this commit soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant