-
Notifications
You must be signed in to change notification settings - Fork 21
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
JKS not found and java.io.FileNotFoundException: https://discovery.meethue.com/ #62
Comments
Then I skipped discovery and tried to connect with known IP address. But after that when I try to connect with the assigned API key, I get this exception:
|
is this project abandoned ? |
yes it is ! |
Hi there! Sorry about this, I do not consider this project abandoned at all, the development has just been slow... Is this issue with the version from the Maven repository? Could you try with the master version from this Git repo? |
Hi, This issue is with the master from Git repo. But the bridge discovery does not work for me. Both MDNS and NUPNP methods in fact find an IP (I've put some debug messages to the discoverers and I can see that both methods are able to get the IP of the bridge) Future<List> bridgesFuture = new HueBridgeDiscoveryService() |
Btw, I changed "getUrlConnection" function in v2.Hue class as in following. Otherwise it was using http and did not succeed.
And how shall we solve the issue with discovery ? Does it work for you ? |
First of all, I forgot to thank you for opening this issue, so: thank you! I rely on diligent users like you to get notified if the library has any issues! 💪 Furthermore it gives me the motivation to fix it when I know somebody is using it. I've confirmed the bridge discovery doesn't work for me either. The certificate stuff was patched elsewhere, but it seems the discovery part was overlooked! Before I manage to get it fixed, using new HueBridgeDiscoveryService()
.discoverBridges(bridge -> System.out.println("Bridge found: " + bridge), HueBridgeProtocol.UNVERIFIED_HTTPS); |
OK I got it now actually: you (and I) are running old Bridges that are still using self-signed certificates. You can read more about it here: https://developers.meethue.com/develop/application-design-guidance/using-https/ So the only option is indeed to use the UNVERIFIED_HTTP method for now. I'll go ahead and change the default discovery protocol to UNVERIFIED_HTTPS so people don't have to worry about that by default. |
Would you please try the freshly minted version 3.0.0-beta-2 from the Maven repository and let me know how it works for you now! 🙏 |
With the new version , I can confirm that the discovery is working. (I tried both MDNS and NUPNP. I have 4 questions:
But I get the warning that Color() is defined as private in Color/Color class. If I change it to "public" , it works.
However, this might not be the optimal way of doing it. Why don't you add getLightByName ? is it not efficient ? I know these questions are not related to the issue I've opened. If you prefer I can open another issue for these. |
did you receive my message yesterday ? |
I did but I've been busy, sorry! Of the top of my head I can answer to your question number 1: take a look at the Color.of(...) methods. Those build the new Color instances. :) I'll get to the other questions later. |
Note that this verifiable Signify-signed certificate is actually a very recent thing, everyone has been operating for years with the unverified connection -- or most likely with the completely insecure plain HTTP connection, actually. |
Thanks for these answers.
Can you tell me how to choose between verified and unverified one ? |
Hi, will you be able to check my 3rd and 4th questions above ? And my last post ? Btw, do you support scenes (and dynamic scenes) in the API ? |
3 & 4: I could add methods for these. The only issue with lights is that it's quite possible for many rooms to have lights with identical names. That possibility could be emphasized by returning a List... Of course it's possible for even the same room to have lights with the same name, but I think that's so rare that the library just picks one of them. |
Yes, scenes are supported: room.getSceneByName("Tropical twilight").ifPresent(Scene::activate); Rooms also have a |
As for verified vs unverified HTTPS connection, for a private project I'd only use myself I'd choose the verified HTTPS if my Bridge supported it. For a public project I'd have to go with the unverified HTTPS because not everyone's Bridges have the Signify-signed certificates yet. I don't think Google Play cares whether your application talks to trusted or untrusted servers, or that it would force your app to do anything. I bet you need to sign your application somehow before submitting it to Google Play Store, but that's a different story entirely and has nothing to do with your or anyone's Hue Bridge setup. The difference between a verified and an unverified HTTPS connection here is that if it's a verified one you can trust that your app is actually talking to a Hue Bridge, and if it's not, there could, in theory, be a man in the middle between your app and the intended Bridge. The contents are still encrypted though, so you're safe from the traditional kind of eavesdropping anyway. I find these a little far-fetched threats though. Someone would basically need to take over your LAN, and at that point you'd have bigger issues to worry about than some malicious system pretending to be your Bridge. |
I have more than 30 apps on Google Play. I know a lot about publishing an app :) So, I have to implement something which at least checks the publisher of the certificate (even if I will trust without authoritive signature check) (see my workaround before you made changes , post 6) In your library, how can I select to use verified or unverified https ? |
Wow, OK, well, I stand corrected! Thanks for educating me! The |
I'll work on removing the unverified part altogether and adding an as-good-as-possible verifier for the self-signed certificates. |
did you have a chance to work on this ? |
As a matter of fact I did! I think I'm pretty close to being able to publish a new version. I would remove the old Hue class at this point and have everyone move to using the new .v2.Hue class instead, but to do that I need to refactor it some more, like by moving the new light discovery code into the new class and hopefully somehow making sure you could still add an unassigned light into a room. |
ok. I modified some classes slightly to be able to try HTTPS first and if it fails use UNVERIFIED_HTTPS I also modified your TrustEverythingManager with checkServerTrusted as: public void checkServerTrusted(final X509Certificate[] certs, final String authType) throws CertificateException { |
Alright, a new version is out: if you could please try |
Thanks for informing me. Actually, I am too busy nowadays to try it. As I wrote in my previous response, I made changes to solve issues I came across and it is working fine for me. Also, when I look at your commits today, I don't see how you handled the bridges with self signed certificate. |
Ok, fair enough! If you do have time to try it one day, I'd appreciate if you let me know how it went. The changes to the certificate handling are here: 84ae774 |
I created a new simple app which only connects to the bridge and lists rooms. |
I am trying to run an example app. But it throws the following exception when I use it as written in README
So I changed the line in SecureJsonFactory.java:
Now, I don't get the JKS not found error:
what is wrong ?
The text was updated successfully, but these errors were encountered: