# How to enable OpenSSL when loading the plugin in my own jar

**URL:** <https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323>\
**Category:** Search Guard\
**Created:** [November 18, 2016, 6:40pm UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323 "2016-11-18T18:40:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Augusto\_Altman\_Quaranta](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Augusto\_Altman\_Quaranta](https://forum.search-guard.com/u/Augusto_Altman_Quaranta)\
**Post date:** [November 18, 2016, 6:40pm UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323/1 "2016-11-18T18:40:30Z")

</div>

Hello everybody, hope you’re doping great.

I have successfully integrated search-guard-ssl v2.0.1.16 plugin onto a Java (8) project of my own that uses the Elasticsearch Java API. I’ve followed [this post](https://floragunn.com/searchguard-elasicsearch-transport-clients/) and it’s working fine. On the other hand I have successfully enabled OpenSSL on all of my ES nodes (thanks to [this doc](https://github.com/floragunncom/search-guard-ssl-docs/blob/master/openssl.md), section ‘dynamically linked’).

The problem comes when I try to enable OpenSSL on my Java project. I don’t know exactly how to do this, I’ve tried different things and I’m always getting the following log:

Open SSL not available because of java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path

``

To add a little more of complexity to the deal, I need to dynamically enable OpenSSL, just as I do with the ES nodes. If the netty-tcnative jar is available at some path then my service should start with OpenSSL.

Best,

Augusto.-

---

<div class="post-metadata">

**Author:** ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)\
**Post date:** [November 19, 2016, 10:03am UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323/2 "2016-11-19T10:03:13Z")

</div>

did you install also apr (libapr1)?

> **···**
>
> > Am 18.11.2016 um 19:40 schrieb Augusto Altman Quaranta \<augusto.altman@gmail.com\>:
> > 
> > Hello everybody, hope you're doping great.
> > 
> > I have successfully integrated search-guard-ssl v2.0.1.16 plugin onto a Java (8) project of my own that uses the Elasticsearch Java API. I've followed this post and it's working fine. On the other hand I have successfully enabled OpenSSL on all of my ES nodes (thanks to this doc, section 'dynamically linked').
> > 
> > The problem comes when I try to enable OpenSSL on my Java project. I don't know exactly how to do this, I've tried different things and I'm always getting the following log:  
> > Open SSL not available because of java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path
> > 
> > To add a little more of complexity to the deal, I need to dynamically enable OpenSSL, just as I do with the ES nodes. If the netty-tcnative jar is available at some path then my service should start with OpenSSL.
> > 
> > Best,  
> > Augusto.-
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Search Guard" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to search-guard+unsubscribe@googlegroups.com.  
> > To post to this group, send email to search-guard@googlegroups.com.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/545ad5e4-a11d-4e06-ac47-f02ba38ebd20%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/545ad5e4-a11d-4e06-ac47-f02ba38ebd20%40googlegroups.com%5C).  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Augusto\_Altman\_Quaranta](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Augusto\_Altman\_Quaranta](https://forum.search-guard.com/u/Augusto_Altman_Quaranta)\
**Post date:** [November 19, 2016, 12:58pm UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323/3 "2016-11-19T12:58:52Z")

</div>

Yes I did.

> **···**
>
> El sábado, 19 de noviembre de 2016, 7:03:14 (UTC-3), Search Guard escribió:
> 
> > did you install also apr (libapr1)?
> > 
> > > Am 18.11.2016 um 19:40 schrieb Augusto Altman Quaranta [augusto...@gmail.com](mailto:augusto...@gmail.com):
> > 
> > > Hello everybody, hope you’re doping great.
> > 
> > > I have successfully integrated search-guard-ssl v2.0.1.16 plugin onto a Java (8) project of my own that uses the Elasticsearch Java API. I’ve followed this post and it’s working fine. On the other hand I have successfully enabled OpenSSL on all of my ES nodes (thanks to this doc, section ‘dynamically linked’).
> > 
> > > The problem comes when I try to enable OpenSSL on my Java project. I don’t know exactly how to do this, I’ve tried different things and I’m always getting the following log:
> > 
> > > Open SSL not available because of java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path
> > 
> > > To add a little more of complexity to the deal, I need to dynamically enable OpenSSL, just as I do with the ES nodes. If the netty-tcnative jar is available at some path then my service should start with OpenSSL.
> > 
> > > Best,
> > 
> > > Augusto.-
> > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups “Search Guard” group.
> > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [search-guard...@googlegroups.com](mailto:search-guard...@googlegroups.com).
> > 
> > > To post to this group, send email to [search...@googlegroups.com](mailto:search...@googlegroups.com).
> > 
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/545ad5e4-a11d-4e06-ac47-f02ba38ebd20%40googlegroups.com](https://groups.google.com/d/msgid/search-guard/545ad5e4-a11d-4e06-ac47-f02ba38ebd20%40googlegroups.com).
> > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)\
**Post date:** [November 19, 2016, 4:43pm UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323/4 "2016-11-19T16:43:09Z")

</div>

Maybe our unit tests can help you: [https://github.com/floragunncom/search-guard-ssl/blob/master/src/test/java/com/floragunn/searchguard/ssl/OpenSSLTest.java](https://github.com/floragunncom/search-guard-ssl/blob/master/src/test/java/com/floragunn/searchguard/ssl/OpenSSLTest.java)  
You also may want to read [Forked Tomcat Native · netty/netty Wiki · GitHub](https://github.com/netty/netty/wiki/Forked-Tomcat-Native)

> **···**
>
> > Am 19.11.2016 um 13:58 schrieb Augusto Altman Quaranta \<augusto.altman@gmail.com\>:
> > 
> > Yes I did.
> > 
> > El sábado, 19 de noviembre de 2016, 7:03:14 (UTC-3), Search Guard escribió:  
> > did you install also apr (libapr1)?
> > 
> > \> Am 18.11.2016 um 19:40 schrieb Augusto Altman Quaranta \<augusto...@gmail.com\>:  
> > \>  
> > \>  
> > \> Hello everybody, hope you're doping great.  
> > \>  
> > \> I have successfully integrated search-guard-ssl v2.0.1.16 plugin onto a Java (8) project of my own that uses the Elasticsearch Java API. I've followed this post and it's working fine. On the other hand I have successfully enabled OpenSSL on all of my ES nodes (thanks to this doc, section 'dynamically linked').  
> > \>  
> > \> The problem comes when I try to enable OpenSSL on my Java project. I don't know exactly how to do this, I've tried different things and I'm always getting the following log:  
> > \> Open SSL not available because of java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path  
> > \>  
> > \> To add a little more of complexity to the deal, I need to dynamically enable OpenSSL, just as I do with the ES nodes. If the netty-tcnative jar is available at some path then my service should start with OpenSSL.  
> > \>  
> > \> Best,  
> > \> Augusto.-  
> > \>  
> > \> --  
> > \> You received this message because you are subscribed to the Google Groups "Search Guard" group.  
> > \> To unsubscribe from this group and stop receiving emails from it, send an email to search-guard...@googlegroups.com.  
> > \> To post to this group, send email to search...@googlegroups.com.  
> > \> To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/545ad5e4-a11d-4e06-ac47-f02ba38ebd20%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/545ad5e4-a11d-4e06-ac47-f02ba38ebd20%40googlegroups.com%5C).  
> > \> For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Search Guard" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to search-guard+unsubscribe@googlegroups.com.  
> > To post to this group, send email to search-guard@googlegroups.com.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/4aae3d72-34fe-41e0-baa3-7388009f8b1b%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/4aae3d72-34fe-41e0-baa3-7388009f8b1b%40googlegroups.com%5C).  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Augusto\_Altman\_Quaranta](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Augusto\_Altman\_Quaranta](https://forum.search-guard.com/u/Augusto_Altman_Quaranta)\
**Post date:** [November 19, 2016, 9:01pm UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323/5 "2016-11-19T21:01:34Z")

</div>

Ok I will! thank you for sharing those links :).

In the meantime I want to clarify my current situation. First of all I have no problem with netty-tcnative itself nor with search-guard-ssl plugin. I have my entire ES cluster using the plugin + OpenSSL and I have gotten the following log on every single node:  
[INFO][com.floragunn.searchguard.ssl.SearchGuardKeyStore] Open SSL OpenSSL 1.0.2j-fips 26 sep 2016 available

``

So search-guard-ssl is working just fine with OpenSSL. My problem comes when I load search-guard-ssl from my own java code as specified on [this post (Using Transport Clients with Search Guard)](https://floragunn.com/searchguard-elasicsearch-transport-clients/). To be completely honest I have no idea what should do I for enabling OpenSSL when I load the plugin from my own jar. I mean… for a regular ES node is as simple as pasting the netty-tcnative jar on the search-guard-ssl plugin folder. But, which are the steps for enabling it from a java project using a transport client?

Thank you very much for helping me.

Best, Augusto.-

> **···**
>
> El viernes, 18 de noviembre de 2016, 15:40:30 (UTC-3), Augusto Altman Quaranta escribió:
> 
> > Hello everybody, hope you’re doping great.
> 
> > I have successfully integrated search-guard-ssl v2.0.1.16 plugin onto a Java (8) project of my own that uses the Elasticsearch Java API. I’ve followed [this post](https://floragunn.com/searchguard-elasicsearch-transport-clients/) and it’s working fine. On the other hand I have successfully enabled OpenSSL on all of my ES nodes (thanks to [this doc](https://github.com/floragunncom/search-guard-ssl-docs/blob/master/openssl.md), section ‘dynamically linked’).
> 
> > 
> 
> > The problem comes when I try to enable OpenSSL on my Java project. I don’t know exactly how to do this, I’ve tried different things and I’m always getting the following log:
> 
> > Open SSL not available because of java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path
> 
> > ``
> 
> > 
> 
> > To add a little more of complexity to the deal, I need to dynamically enable OpenSSL, just as I do with the ES nodes. If the netty-tcnative jar is available at some path then my service should start with OpenSSL.
> 
> > 
> 
> > Best,
> 
> > Augusto.-

---

<div class="post-metadata">

**Author:** ![Augusto\_Altman\_Quaranta](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Augusto\_Altman\_Quaranta](https://forum.search-guard.com/u/Augusto_Altman_Quaranta)\
**Post date:** [November 23, 2016, 6:31pm UTC](https://forum.search-guard.com/t/how-to-enable-openssl-when-loading-the-plugin-in-my-own-jar/323/6 "2016-11-23T18:31:58Z")

</div>

I solved it.

I’m using Spring Boot which ultimately generates a fat jar that you have to run using:

java -jar mysSpringBootApp.jar

``

Inside that fat jar is the Search Guard SSL plugin among other things (Elasticsearch, my java classes, etc). I wasn’t able to tell the Search Guard SSL plugin where the netty-tcnative jar was in order to load it. After reading some code and digging a little about how Spring Boot bootstrap an application I managed to solve this problem by running my application like this (linux):

java -cp “/path/to/my/jar/mysSpringBootApp.jar:path/to/tcnative/jar/netty-tcnative.jar” org.springframework.boot.loader.JarLauncher

``

Augusto.-

> **···**
>
> El sábado, 19 de noviembre de 2016, 18:01:34 (UTC-3), Augusto Altman Quaranta escribió:
> 
> > Ok I will! thank you for sharing those links :).
> 
> > In the meantime I want to clarify my current situation. First of all I have no problem with netty-tcnative itself nor with search-guard-ssl plugin. I have my entire ES cluster using the plugin + OpenSSL and I have gotten the following log on every single node:  
> > [INFO][com.floragunn.searchguard.ssl.SearchGuardKeyStore] Open SSL OpenSSL 1.0.2j-fips 26 sep 2016 available
> 
> > ``
> 
> > 
> 
> > So search-guard-ssl is working just fine with OpenSSL. My problem comes when I load search-guard-ssl from my own java code as specified on [this post (Using Transport Clients with Search Guard)](https://floragunn.com/searchguard-elasicsearch-transport-clients/). To be completely honest I have no idea what should do I for enabling OpenSSL when I load the plugin from my own jar. I mean… for a regular ES node is as simple as pasting the netty-tcnative jar on the search-guard-ssl plugin folder. But, which are the steps for enabling it from a java project using a transport client?
> 
> > 
> 
> > Thank you very much for helping me.
> 
> > 
> 
> > Best, Augusto.-
> > 
> > El viernes, 18 de noviembre de 2016, 15:40:30 (UTC-3), Augusto Altman Quaranta escribió:
> > 
> > > Hello everybody, hope you’re doping great.
> 
> > > I have successfully integrated search-guard-ssl v2.0.1.16 plugin onto a Java (8) project of my own that uses the Elasticsearch Java API. I’ve followed [this post](https://floragunn.com/searchguard-elasicsearch-transport-clients/) and it’s working fine. On the other hand I have successfully enabled OpenSSL on all of my ES nodes (thanks to [this doc](https://github.com/floragunncom/search-guard-ssl-docs/blob/master/openssl.md), section ‘dynamically linked’).
> 
> > >
> 
> > > The problem comes when I try to enable OpenSSL on my Java project. I don’t know exactly how to do this, I’ve tried different things and I’m always getting the following log:
> 
> > > Open SSL not available because of java.lang.UnsatisfiedLinkError: no netty-tcnative in java.library.path
> 
> > > ``
> 
> > >
> 
> > > To add a little more of complexity to the deal, I need to dynamically enable OpenSSL, just as I do with the ES nodes. If the netty-tcnative jar is available at some path then my service should start with OpenSSL.
> 
> > >
> 
> > > Best,
> 
> > > Augusto.-
