You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Mark Derricutt <ma...@talios.com> on 2020/06/15 03:37:53 UTC
Integrating OpenJSEE into Karaf on JDK8
Hey all,
I was wondering if anyone here had tried integrating/running OpenJSEE ( https://github.com/openjsse/openjsse ) under Karaf on JDk8 at all? (we're wanting to make use of TLS 1.3 ).
I've created a simple bundle wrapping the library, and calling `java.security.Security#insertProviderAt` which we currently use on a non-Kara based project, but when I try and build a distribution I rightly get told off about the bundle wanting to access `sun.net.util`:
```
resolution:=mandatory [caused by: Unable to resolve
com.smxemail.openjsse/1.0.1.SNAPSHOT: missing
requirement [com.smxemail.openjsse/1.0.1.SNAPSHOT] osgi.wiring.package;
filter:="(osgi.wiring.package=sun.net.util)"]]
```
Ideally I don't want to patch the `jre.properties` and export the `sun.net.util` package (and likely others) so wondering if anyone had any ideas, one option I'm thinking of trying is copying the `openjsee.jar` dependency into the `karaf/lib/boot` folder, or set add the `org.openjsse.net.ssl` package to delegate to the boot class loader.
All of these feel somewhat messy, so if there was some way I could handle it all inside a bundle/karaf-feature that would be preferable.
Cheers,
Mark
---
"The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." — Mark Reinhold.
Mark Derricutt
http://www.chaliceofblood.net
http://www.theoryinpractice.net
http://twitter.com/talios
http://facebook.com/mderricutt
Re: Integrating OpenJSEE into Karaf on JDK8
Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,
I would set sun.net <http://sun.net/>.util as optional.
It should be straight forward.
Regards
JB
> Le 15 juin 2020 à 05:37, Mark Derricutt <ma...@talios.com> a écrit :
>
> Hey all,
>
> I was wondering if anyone here had tried integrating/running OpenJSEE ( https://github.com/openjsse/openjsse <https://github.com/openjsse/openjsse> ) under Karaf on JDk8 at all? (we're wanting to make use of TLS 1.3 ).
>
> I've created a simple bundle wrapping the library, and calling java.security.Security#insertProviderAt which we currently use on a non-Kara based project, but when I try and build a distribution I rightly get told off about the bundle wanting to access sun.net.util:
>
> resolution:=mandatory [caused by: Unable to resolve
> com.smxemail.openjsse/1.0.1.SNAPSHOT: missing
> requirement [com.smxemail.openjsse/1.0.1.SNAPSHOT] osgi.wiring.package;
> filter:="(osgi.wiring.package=sun.net.util)"]]
> Ideally I don't want to patch the jre.properties and export the sun.net.util package (and likely others) so wondering if anyone had any ideas, one option I'm thinking of trying is copying the openjsee.jar dependency into the karaf/lib/boot folder, or set add the org.openjsse.net.ssl package to delegate to the boot class loader.
>
> All of these feel somewhat messy, so if there was some way I could handle it all inside a bundle/karaf-feature that would be preferable.
>
> Cheers,
> Mark
>
> "The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." — Mark Reinhold.
>
> Mark Derricutt
> http://www.chaliceofblood.net <http://www.chaliceofblood.net/>
> http://www.theoryinpractice.net <http://www.theoryinpractice.net/>
> http://twitter.com/talios <http://twitter.com/talios>
> http://facebook.com/mderricutt <http://facebook.com/mderricutt>
Re: Integrating OpenJSEE into Karaf on JDK8
Posted by Johan Edstrom <se...@gmail.com>.
Oh, I’ve gotten axis one running in Karaf, you might have to override a
class loader or two, but you learn alot about the JDK :)
> On Jun 14, 2020, at 11:21 PM, Mark Derricutt <ma...@talios.com> wrote:
>
> Woo – I _may_ have spoken too soon – after adding a few more !imports – the bundle activator runs and everything _appears_ to be active with no exceptions.
>
> Of course – the next step is getting something to call/respond to an HTTPS endpoint – but progress.
>
>
> From: Johan Edstrom <seijoed@gmail.com <ma...@gmail.com>>
> Reply to: "user@karaf.apache.org <ma...@karaf.apache.org>" <user@karaf.apache.org <ma...@karaf.apache.org>>
> Date: Monday, 15 June 2020 at 4:19 PM
> To: "user@karaf.apache.org <ma...@karaf.apache.org>" <user@karaf.apache.org <ma...@karaf.apache.org>>
> Subject: Re: Integrating OpenJSEE into Karaf on JDK8
>
> Are some of those possibly something you could make optional?
> Dealing with old jars compile chains can be really enlightening in osgi :)
Re: Integrating OpenJSEE into Karaf on JDK8
Posted by Mark Derricutt <ma...@talios.com>.
Woo – I _may_ have spoken too soon – after adding a few more !imports – the bundle activator runs and everything _appears_ to be active with no exceptions.
Of course – the next step is getting something to call/respond to an HTTPS endpoint – but progress.
From: Johan Edstrom <se...@gmail.com>
Reply to: "user@karaf.apache.org" <us...@karaf.apache.org>
Date: Monday, 15 June 2020 at 4:19 PM
To: "user@karaf.apache.org" <us...@karaf.apache.org>
Subject: Re: Integrating OpenJSEE into Karaf on JDK8
Are some of those possibly something you could make optional?
Dealing with old jars compile chains can be really enlightening in osgi :)
Re: Integrating OpenJSEE into Karaf on JDK8
Posted by Mark Derricutt <ma...@talios.com>.
So far I’ve been going thru add !sun.util….. etc. to my config and seeing what shows up – but it’s looking pretty much what I expected – A LOT of internal web/network fundamentals ( sun.net.www.http etc. ) all of which I’m guessing are extended/implemented by the OpenJSSE library ( which was a backport/extraction from JDK 11 ) so it’s part of the core/low level stack of Java.
I don’t think this route will be of much use, but I suspect I may have better results including the base jar in the lib/boot folder, and my bundle merely instantiating the class.
From: Johan Edstrom <se...@gmail.com>
Reply to: "user@karaf.apache.org" <us...@karaf.apache.org>
Date: Monday, 15 June 2020 at 4:19 PM
To: "user@karaf.apache.org" <us...@karaf.apache.org>
Subject: Re: Integrating OpenJSEE into Karaf on JDK8
Are some of those possibly something you could make optional?
Dealing with old jars compile chains can be really enlightening in osgi :)
Re: Integrating OpenJSEE into Karaf on JDK8
Posted by Johan Edstrom <se...@gmail.com>.
Are some of those possibly something you could make optional?
Dealing with old jars compile chains can be really enlightening in osgi :)
> On Jun 14, 2020, at 9:37 PM, Mark Derricutt <ma...@talios.com> wrote:
>
> Hey all,
>
> I was wondering if anyone here had tried integrating/running OpenJSEE ( https://github.com/openjsse/openjsse <https://github.com/openjsse/openjsse> ) under Karaf on JDk8 at all? (we're wanting to make use of TLS 1.3 ).
>
> I've created a simple bundle wrapping the library, and calling java.security.Security#insertProviderAt which we currently use on a non-Kara based project, but when I try and build a distribution I rightly get told off about the bundle wanting to access sun.net.util:
>
> resolution:=mandatory [caused by: Unable to resolve
> com.smxemail.openjsse/1.0.1.SNAPSHOT: missing
> requirement [com.smxemail.openjsse/1.0.1.SNAPSHOT] osgi.wiring.package;
> filter:="(osgi.wiring.package=sun.net.util)"]]
> Ideally I don't want to patch the jre.properties and export the sun.net.util package (and likely others) so wondering if anyone had any ideas, one option I'm thinking of trying is copying the openjsee.jar dependency into the karaf/lib/boot folder, or set add the org.openjsse.net.ssl package to delegate to the boot class loader.
>
> All of these feel somewhat messy, so if there was some way I could handle it all inside a bundle/karaf-feature that would be preferable.
>
> Cheers,
> Mark
>
> "The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." — Mark Reinhold.
>
> Mark Derricutt
> http://www.chaliceofblood.net <http://www.chaliceofblood.net/>
> http://www.theoryinpractice.net <http://www.theoryinpractice.net/>
> http://twitter.com/talios <http://twitter.com/talios>
> http://facebook.com/mderricutt <http://facebook.com/mderricutt>