ciao!
nella mia applicazione con vert.x, sto cercando di impostare un SelfSignedCertificate in modo da usare HTTPS:
codice:
SelfSignedCertificate certificate = SelfSignedCertificate.create();
HttpServerOptions serverOptions = new HttpServerOptions()
.setSsl(true)
.setKeyCertOptions(certificate.keyCertOptions())
.setTrustOptions(certificate.trustOptions());
ma quando vado ad avviare l'appilcazione ottengo questo errore:
codice:
GRAVE: java.security.cert.CertificateException: No provider succeeded to generate a self-signed certificate. See debug log for the root cause.
java.security.cert.CertificateException: No provider succeeded to generate a self-signed certificate. See debug log for the root cause.
at io.netty.handler.ssl.util.SelfSignedCertificate.<init>(SelfSignedCertificate.java:249)
at io.netty.handler.ssl.util.SelfSignedCertificate.<init>(SelfSignedCertificate.java:166)
at io.netty.handler.ssl.util.SelfSignedCertificate.<init>(SelfSignedCertificate.java:115)
at io.netty.handler.ssl.util.SelfSignedCertificate.<init>(SelfSignedCertificate.java:90)
at io.vertx.core.net.impl.SelfSignedCertificateImpl.<init>(SelfSignedCertificateImpl.java:28)
at io.vertx.core.net.SelfSignedCertificate.create(SelfSignedCertificate.java:66)
at com.zara.api.zara_api.MainVerticle.start(MainVerticle.java:108)
at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$5(DeploymentManager.java:196)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:246)
at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:43)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Suppressed: java.lang.NoClassDefFoundError: org/bouncycastle/cert/X509v3CertificateBuilder
at io.netty.handler.ssl.util.SelfSignedCertificate.<init>(SelfSignedCertificate.java:240)
... 18 more
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.cert.X509v3CertificateBuilder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 19 more
Caused by: java.lang.IllegalAccessError: class io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator (in unnamed module @0x21213b92) cannot access class sun.security.x509.X509CertInfo (in module java.base) because module java.base does not export sun.security.x509 to unnamed module @0x21213b92
at io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator.generate(OpenJdkSelfSignedCertGenerator.java:52)
at io.netty.handler.ssl.util.SelfSignedCertificate.<init>(SelfSignedCertificate.java:246)
... 18 more
suppongo debba installare una dipendenza, e penso sia questa: https://mvnrepository.com/artifact/org.bouncycastle
sto usando JDK17, e li non vedo una versione per la 17.
qualcuno sa dirmi di più??