Skip to content
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

config_builder SSL issues with dyson API #14

Closed
Scaredycrow opened this issue Sep 12, 2021 · 6 comments
Closed

config_builder SSL issues with dyson API #14

Scaredycrow opened this issue Sep 12, 2021 · 6 comments

Comments

@Scaredycrow
Copy link

Hi There,

This is a heads-up, I don't believe the issue I'm facing is your code, but thought I'd report it.

When running the config builder I currently get errors relating to ssl validation failures.

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)

However, this is because dyson has incorrectly applied their certificate which can be verified with curl and openssl:

~$ curl https://appapi.cp.dyson.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
~$ openssl s_client -servername appapi.cp.dyson.com -connect appapi.cp.dyson.com:443
CONNECTED(00000003)
depth=0 C = GB, L = Malmesbury, O = Dyson Limited, CN = *.dyson.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = GB, L = Malmesbury, O = Dyson Limited, CN = *.dyson.com
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:C = GB, L = Malmesbury, O = Dyson Limited, CN = *.dyson.com
   i:C = US, O = DigiCert Inc, CN = DigiCert TLS RSA SHA256 2020 CA1
---

This can be further validated using ssllabs which reports the same:
image

@seanrees
Copy link
Owner

seanrees commented Sep 12, 2021

Thanks for filing :-)

I'm pretty sure this was addressed by shenxn/libdyson#14 which imported the new DigiCert certificates. I pushed release 0.3.2 to pick up this change (https://github.com/seanrees/prometheus-dyson/releases/tag/v0.3.2). I'm guessing you're having issues?

If you're building from source you'll likely need to upgrade libdyson -- running bazel clean followed by a build ought to do it, or pip3 install -U libdyson if not using bazel.

@Scaredycrow
Copy link
Author

Thanks for the response.

I'm using the precompiled .deb v0.3.2. on a clean ubuntu server 20.04.3 LTS install.

Just tested after running the pip3 upgrade for libdyson, no change unfortunately.

@seanrees
Copy link
Owner

Got it, thanks! Verified the issue and raised a PR (shenxn/libdyson#16) to fix.

As soon as that goes in & there's a fresh release of libdyson, I'll re-release 0.3.3 of prometheus-dyson :-)

@Scaredycrow
Copy link
Author

hi @seanrees Is there an update on this issue? I can see that:

  • The reference PR above is closed
  • The SSL certificates when using curl are no longer showing an error

However the config_builder still fails with the same errors.

Happy to assist with testing etc.

seanrees added a commit that referenced this issue Jan 3, 2022
This should address #14 (again? :-))
@seanrees
Copy link
Owner

seanrees commented Jan 3, 2022

Happy New Year :)

I just published v0.3.3 which picks up a new libdyson, which hopefully should resolve the certificate errors for you. Care to give it a whirl?

@Scaredycrow
Copy link
Author

Thanks, and happy new year!

0.3.3 solves the SSL issue!

However I'm seeing a new issue with the OTP validation. I'll go ahead and open a new issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants