apns-http2
apns-http2 copied to clipboard
JDK9+ Support
We're attempting to upgrade to JDK10, and encountred this issue with OkHttp.
Seems like OkHttp 3.10.0 has support for Java9, but the call to one of the methods results in an
UnsupportedOperationException
.
Stacktrace:
Jun 14, 2018 9:36:46 AM com.google.inject.internal.MessageProcessor visit INFO: An exception was caught and reported. Message: java.lang.UnsupportedOperationException: clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+ java.lang.UnsupportedOperationException: clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+ at okhttp3.internal.platform.Jdk9Platform.trustManager(Jdk9Platform.java:81) at okhttp3.internal.platform.Platform.buildCertificateChainCleaner(Platform.java:176) at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.java:673) at com.clevertap.apns.clients.SyncOkHttpApnsClient.
(SyncOkHttpApnsClient.java:144) at com.clevertap.apns.clients.ApnsClientBuilder.build(ApnsClientBuilder.java:172) at co.zeekit.server.module.notification.Push.configure(Push.java:24) at org.jooby.Jooby.install(Jooby.java:3421) at org.jooby.Jooby.lambda$bindService$50(Jooby.java:3082) at org.jooby.funzy.Throwing$Consumer.lambda$accept$0(Throwing.java:273) at org.jooby.funzy.Throwing.runAction(Throwing.java:2415) at org.jooby.funzy.Throwing.access$000(Throwing.java:39) at org.jooby.funzy.Throwing$Consumer.accept(Throwing.java:273) at org.jooby.Jooby.lambda$null$44(Jooby.java:2932) at org.jooby.funzy.Throwing.runAction(Throwing.java:2415) at org.jooby.funzy.Throwing.access$000(Throwing.java:39) at org.jooby.funzy.Throwing$Runnable.run(Throwing.java:86) at org.jooby.funzy.Try.run(Try.java:729) at org.jooby.Jooby.lambda$bootstrap$47(Jooby.java:2919) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) at com.google.inject.spi.Elements.getElements(Elements.java:110) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) at com.google.inject.Guice.createInjector(Guice.java:99) at com.google.inject.Guice.createInjector(Guice.java:84) at org.jooby.Jooby.lambda$new$0(Jooby.java:882) at org.jooby.Jooby.bootstrap(Jooby.java:2996) at org.jooby.Jooby.start(Jooby.java:2195) at org.jooby.Jooby.start(Jooby.java:2176) at org.jooby.Jooby.start(Jooby.java:2165) at co.zeekit.server.ServerResource.before(ServerResource.java:82) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Actually I'm not sure if this is a apns issue. EDIT: Just this call breaks code: https://github.com/CleverTap/apns-http2/blob/192e7205c7554097f126256e4ab0c79d6adc75c1/src/main/java/com/clevertap/apns/clients/SyncOkHttpApnsClient.java#L185
@aclowkey JDK 9 will not be supported. See https://github.com/CleverTap/apns-http2/wiki/Running-on-Java-9.
There's no way for us to set the authorization header, and Oracle won't back port the fix.
@judepereira Oh okay, thanks.
@judepereira This library uses Ok Http which says it supports HTTP2+, can't we use these implementation rather than Oracles?
@aclowkey Ah yes! My bad. Yes, we can continue using HTTP/2 support from OkHttp.
Have you been able to get it working? Does it still require Jetty's ALPN library?
@judepereira I've been able to compile it successfully but didn't actually test the functionality. I didn't need to use ALPN.
We're using APN as legacy support, now my task is to see if we actually need this support at all.
Can you run a quick test on it?
I don't have the option at the moment. I will as soon as I can and will update
On Thu, 14 Jun 2018 at 16:24, Jude Pereira [email protected] wrote:
Can you run a quick test on it?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CleverTap/apns-http2/issues/44#issuecomment-397294790, or mute the thread https://github.com/notifications/unsubscribe-auth/AB9y2SbmkTsVGfrHlIFRPT6oN-1UxeVYks5t8mQngaJpZM4UnaEL .
@judepereira We have decided to deprecate the APNS use since we don't have any users subscribed to it.
I would be happy to help in testing, however, I don't have the means an (IOS device ,etc)
This seems to still be the case on jdk-11.
@judepereira Can you take a look on this pr? 👆🏼
@DziubaR On it :)