VertxException: OpenSSL is not available

490 views
Skip to first unread message

Daniel Lindberg

unread,
Sep 7, 2016, 10:57:04 AM9/7/16
to vert.x
I have a box where I'm trying to run with a vertx 3.3.2 HTTP/2 client using OpenSSL.

OpenSSL is installed, which I checked by running
bash-4.2$ openssl version
OpenSSL 1.0.2h  3 May 2016

However when running my jar file, with java -jar on this same machine, 
vertx says it's unable to find OpenSSL. How come?



ERROR 16:51:16.714 [io.vertx.core.impl.ContextImpl] (vert.x-eventloop-thread-2) - Unhandled exception
io
.vertx.core.VertxException: OpenSSL is not available
        at io
.vertx.core.net.impl.SSLHelper.resolveEngineOptions(SSLHelper.java:79) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.net.impl.SSLHelper.<init>(SSLHelper.java:145) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.http.impl.HttpClientImpl.<init>(HttpClientImpl.java:74) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.VertxImpl.createHttpClient(VertxImpl.java:251) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at com
.bankid.notis.notification.apns.ApnsHttp2ConnectionManager.getOrCreateHttpClient(ApnsHttp2ConnectionManager.java:181) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at com
.bankid.notis.notification.apns.ApnsHttp2ConnectionManager.<init>(ApnsHttp2ConnectionManager.java:65) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at com
.bankid.notis.notification.apns.ApnsVerticle.lambda$onStart$0(ApnsVerticle.java:37) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.FutureImpl.handle(FutureImpl.java:135) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.FutureImpl.handle(FutureImpl.java:23) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.ContextImpl.lambda$null$1(ContextImpl.java:315) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.vertx.core.impl.ContextImpl.lambda$wrapTask$3(ContextImpl.java:359) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:339) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:393) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at io
.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742) ~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]
        at java
.lang.Thread.run(Thread.java:745) ~[na:1.8.0_92]

Julien Viet

unread,
Sep 7, 2016, 11:20:19 AM9/7/16
to ve...@googlegroups.com
Hi

you can check the exception returned by : 

io.netty.handler.ssl.OpenSsl.unavailabilityCause()

to know more details and refer to:

http://netty.io/wiki/forked-tomcat-native.html


--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/b545803e-4e4f-4b75-9c86-29ab06122649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Lehmann

unread,
Sep 7, 2016, 11:52:51 AM9/7/16
to vert.x
Vert.x does not include openssl from Netty as dependency, so you have to add it according to the explanation from netty.

If you are using Windows, there is an issue with the current netty with loading dlls, if you are on Linux, you should be able to use either the dynamic openssl or boringssl, which doesn't have dependencies.

Julien Viet

unread,
Sep 7, 2016, 12:26:51 PM9/7/16
to ve...@googlegroups.com
I’ve added the cause when available in master should be in 3.3.3



        at io
.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)~[notis-bundle-2.0-SNAPSHOT-fat.jar:na]

        at java
.lang.Thread.run(Thread.java:745) ~[na:1.8.0_92]
-- 
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.

Daniel Lindberg

unread,
Sep 7, 2016, 2:11:41 PM9/7/16
to vert.x
@Julien: That's great!

@Alex: I have the following section in my pom.xml, currently running on a RHEL 7

<dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-tcnative</artifactId>
      <version>1.1.33.Fork16</version>
      <classifier>linux-x86_64</classifier>    
</dependency>

Not enough? 

Daniel Lindberg

unread,
Sep 8, 2016, 2:44:26 AM9/8/16
to vert.x
Did some more debugging and looking at the errors from Netty as suggesten by Julien. 
Given what I have in my pom, I was a bit suprised to see the following from Netty

Failed to load any of the given libraries: [netty-tcnative-linux-x86_64, netty-tcnative-linux-x86_64-fedora, netty-tcnative]

Alexander Lehmann

unread,
Sep 8, 2016, 7:01:37 AM9/8/16
to vert.x
Could you please check if your fatjar contains a file /META-INF/native/libnetty-tcnative.so ? If not, there is a rule missing in the building of the fatjar, if the file exists, there may be either a so dependency issue or the file itself fails to load.

You could try to switch to boringssl-static if the file exists, that should at least get rid of dependency issues.

The debug log of netty might contain more info, you can get that by adding log4j and log4j.properties to your classpath.
Reply all
Reply to author
Forward
0 new messages