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

http2-fatjar example gives: SSLException: failed to set certificate and key #175

Closed
matzew opened this issue Feb 14, 2017 · 2 comments

Comments

@matzew
Copy link

commented Feb 14, 2017

Running java -jar target/http2-fatjar-3.3.3.jar gives me:

➜  http2-fatjar git:(master) java -jar target/http2-fatjar-3.3.3.jar 
io.vertx.core.VertxException: javax.net.ssl.SSLException: failed to set certificate and key
	at io.vertx.core.net.impl.SSLHelper.createContext(SSLHelper.java:284)
	at io.vertx.core.net.impl.SSLHelper.getContext(SSLHelper.java:439)
	at io.vertx.core.net.impl.SSLHelper.validate(SSLHelper.java:453)
	at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:219)
	at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:186)
	at io.vertx.example.fatjar.http2.Server.start(Server.java:29)
	at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:111)
	at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:434)
	at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:316)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:440)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: failed to set certificate and key
	at io.netty.handler.ssl.ReferenceCountedOpenSslServerContext.newSessionContext(ReferenceCountedOpenSslServerContext.java:129)
	at io.netty.handler.ssl.OpenSslServerContext.<init>(OpenSslServerContext.java:349)
	at io.netty.handler.ssl.OpenSslServerContext.<init>(OpenSslServerContext.java:334)
	at io.netty.handler.ssl.SslContext.newServerContextInternal(SslContext.java:412)
	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:393)
	at io.vertx.core.net.impl.SSLHelper.createContext(SSLHelper.java:282)
	... 13 more
Caused by: java.lang.IllegalArgumentException: KeyManagerFactory not supported
	at io.netty.handler.ssl.ReferenceCountedOpenSslServerContext.newSessionContext(ReferenceCountedOpenSslServerContext.java:106)
	... 18 more
Feb 14, 2017 10:16:25 AM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
SEVERE: javax.net.ssl.SSLException: failed to set certificate and key
Feb 14, 2017 10:16:25 AM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
SEVERE: javax.net.ssl.SSLException: failed to set certificate and key
io.vertx.core.VertxException: javax.net.ssl.SSLException: failed to set certificate and key
	at io.vertx.core.net.impl.SSLHelper.createContext(SSLHelper.java:284)
	at io.vertx.core.net.impl.SSLHelper.getContext(SSLHelper.java:439)
	at io.vertx.core.net.impl.SSLHelper.validate(SSLHelper.java:453)
	at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:219)
	at io.vertx.core.http.impl.HttpServerImpl.listen(HttpServerImpl.java:186)
	at io.vertx.example.fatjar.http2.Server.start(Server.java:29)
	at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:111)
	at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:434)
	at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:316)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:440)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: failed to set certificate and key
	at io.netty.handler.ssl.ReferenceCountedOpenSslServerContext.newSessionContext(ReferenceCountedOpenSslServerContext.java:129)
	at io.netty.handler.ssl.OpenSslServerContext.<init>(OpenSslServerContext.java:349)
	at io.netty.handler.ssl.OpenSslServerContext.<init>(OpenSslServerContext.java:334)
	at io.netty.handler.ssl.SslContext.newServerContextInternal(SslContext.java:412)
	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:393)
	at io.vertx.core.net.impl.SSLHelper.createContext(SSLHelper.java:282)
	... 13 more
Caused by: java.lang.IllegalArgumentException: KeyManagerFactory not supported
	at io.netty.handler.ssl.ReferenceCountedOpenSslServerContext.newSessionContext(ReferenceCountedOpenSslServerContext.java:106)
	... 18 more

Here is my environment:

mvn -v 
Apache Maven 3.3.9 (NON-CANONICAL_2016-07-01T11:53:38Z_mockbuild; 2016-07-01T13:53:38+02:00)
Maven home: /usr/share/maven
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-1.b14.fc25.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.5-200.fc25.x86_64", arch: "amd64", family: "unix"
@cescoffier

This comment has been minimized.

Copy link
Member

commented Feb 14, 2017

I just fixed it in the 3.4.0-SNAPSHOT branch. It's the tcnative version that was not aligned with the netty version. Can you try this branch ?

@cescoffier

This comment has been minimized.

Copy link
Member

commented Feb 14, 2017

actually, I just fixed master too ;-)

@cescoffier cescoffier closed this Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.