Missing SslContextFactory

getting errors. I think it started after installing one of the latest snapshots. Currently i’m on openHAB 2.4.0 Build #1364

2018-09-16 23:05:03.295 [ERROR] [org.jupnp.transport.spi.StreamClient] - Request: HttpRequest[GET /capability HTTP/1.1]@7c95d877 failed
    java.lang.NullPointerException: Missing SslContextFactory
    at java.util.Objects.requireNonNull(Objects.java:228) ~[?:?]
    at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.<init>(SslClientConnectionFactory.java:50) ~[74:org.eclipse.jetty.io:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1155) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:138) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpDestination.<init>(HttpDestination.java:95) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.PoolingHttpDestination.<init>(PoolingHttpDestination.java:25) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.<init>(HttpDestinationOverHTTP.java:32) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.http.HttpClientTransportOverHTTP.newHttpDestination(HttpClientTransportOverHTTP.java:51) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpClient.destinationFor(HttpClient.java:539) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:572) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:727) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:680) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
    at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:149) [210:org.jupnp:2.4.0]
    at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:1) [210:org.jupnp:2.4.0]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    at java.lang.Thread.run(Thread.java:748) [?:?]

This error message appears when UPNP is scanning my Samsung appliances, I think it’s related to SSL cert on appliance.

I’m getting the same, it’s probably due to the karaf update

Is that a correct forum to discuss snapshots and current issues? If not, what would be the right one?

You’re in the right place, unless you can go into technical detail, then https://github.com/eclipse/smarthome/issues or https://github.com/openhab/openhab-distro/issues would be more constructive

1 Like

I am getting the same repeated messages in the log with the latest update, just updated via apt a few hours ago.

2018-09-19 22:11:39.514 [ERROR] [org.jupnp.transport.spi.StreamClient] - Request: HttpRequest[GET /capability HTTP/1.1]@3e26e79e failed
java.lang.NullPointerException: Missing SslContextFactory
        at java.util.Objects.requireNonNull(Objects.java:228) ~[?:?]
        at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.<init>(SslClientConnectionFactory.java:50) ~[74:org.eclipse.jetty.io:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1155) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:138) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpDestination.<init>(HttpDestination.java:95) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.PoolingHttpDestination.<init>(PoolingHttpDestination.java:25) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.<init>(HttpDestinationOverHTTP.java:32) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.http.HttpClientTransportOverHTTP.newHttpDestination(HttpClientTransportOverHTTP.java:51) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpClient.destinationFor(HttpClient.java:539) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:572) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:727) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:680) ~[70:org.eclipse.jetty.client:9.4.11.v20180605]
        at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:149) [215:org.jupnp:2.4.0]
        at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:1) [215:org.jupnp:2.4.0]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

@wborn could this be related to the karaf update as suggested? I am not seeing any bad behavior, as far as I can tell all of my items/things are working, but it fills up the log.

The startup behavior could have changed with the Karaf upgrade. The bad behavior will probably be that the UPnP discovery no longer works. @Kai do you know how to solve these NPEs with jupnp?

I haven’t yet encountered this error myself, I just tested it with build #1369 and UPnP works nicely here.
I don’t really think that the Karaf upgrade is related - maybe indirectly due to the Jetty upgrade.

Is anyone able to reproduce it easily with a clean fresh installation of the zip and the demo package?

Just had a look at the code. It seems that you have some UPnP device that asks for https for querying its services - and jUPnP simply isn’t prepared for this.
I would claim that the exception goes away, if you remove the specific device from your network. I would be interested in what device this is.
Can you really confirm that UPnP worked with that device in the network in previous openHAB builds? Then something must have changed in Jetty…

Hello @Kai, as I mentioned: This error message appears when UPNP is scanning my Samsung appliances, I think it’s related to SSL cert on appliance. Do you need more details? I can turn on debug and take couple screenshots.

Ah, thanks, I had missed the Samsung part of your message above.
Can you confirm that there wasn’t a problem with earlier snapshots? From the code, it looks to me as if SSL with UPnP could never have worked so far…

There is a chance that you are right :slight_smile: I clearly remember that I’ve never seen such errors util I installed latest release some time in August.
What is actually UPnP doing for OpenHAB? How can I see that it’s working for non-SSL devices?

What is actually UPnP doing for OpenHAB?

Well, it discovers devices through UPnP.

How can I see that it’s working for non-SSL devices?

By successfully discovering such devices. Could be e.g. a Philips hue bridge, which announces itself through (non-ssl) UPnP.

I have entered NPE if https scheme is used by a UPnP device in the network · Issue #109 · jupnp/jupnp · GitHub for tracking this issue.
It would be nice if you could post some trace logging on that issue from your device. Simply enable

log:set TRACE org.jupnp.transport.impl.jetty

and find the log excerpt just before the exceptions appears.

done

Until this is fixed:

log:set OFF org.jupnp
1 Like

Looks like this was’t fixed in 2.4 release. Is there any timelines for this?

Hi anthonygillet,
in which file I have to insert the line?

You can execute that command via SSH from the OH karaf console to disable logging for the jupnp module.

I’m seeing this pretty frequently in OH3 build 1963. I’ll try to capture some relevant debug logs.

2020-10-08 22:27:09.090 [ERROR] [org.jupnp.transport.spi.StreamClient] - Request: HttpRequest[GET /capability HTTP/1.1]@6ecd1c12 failed
java.lang.NullPointerException: Missing SslContextFactory
        at java.util.Objects.requireNonNull(Objects.java:246) ~[?:?]
        at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.<init>(SslClientConnectionFactory.java:54) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1175) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:137) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpDestination.<init>(HttpDestination.java:94) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.PoolingHttpDestination.<init>(PoolingHttpDestination.java:25) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.<init>(HttpDestinationOverHTTP.java:32) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.http.HttpClientTransportOverHTTP.newHttpDestination(HttpClientTransportOverHTTP.java:51) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpClient.destinationFor(HttpClient.java:546) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:579) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:728) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:681) ~[bundleFile:9.4.20.v20190813]
        at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:155) [bundleFile:?]
        at org.jupnp.transport.impl.jetty.JettyStreamClientImpl$1.call(JettyStreamClientImpl.java:1) [bundleFile:?]
        at org.jupnp.transport.spi.AbstractStreamClient$RequestWrapper.call(AbstractStreamClient.java:204) [bundleFile:?]
        at org.jupnp.transport.spi.AbstractStreamClient$RequestWrapper.call(AbstractStreamClient.java:1) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]```

So I see the issue is still open, and we’re on the same version of jupnp as 2.5.x. I guess I’ll just turn off logging like I’ve done in 2.5.x.