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

Bug - Library doesn't validate server certificate expiration #16

Open
JayNewstrom opened this issue Feb 4, 2020 · 4 comments
Open

Bug - Library doesn't validate server certificate expiration #16

JayNewstrom opened this issue Feb 4, 2020 · 4 comments

Comments

@JayNewstrom
Copy link

When trying to connect to a server with an expired certificate, the client connects successfully. This should be rejected, as it's a security risk.

@rojer
Copy link
Contributor

rojer commented Feb 4, 2020

this doesn't just apply to mqtt but to all TLS in mongoose os currently - time validation is not performed.
but i agree, it should be made possible, even if off by default (to maintain compatibility).

@JayNewstrom
Copy link
Author

I see. That's not good! I'd like to help this get fixed. I'd be willing to do the work if you point me in the direction, and are willing to accept the direction.

@rojer
Copy link
Contributor

rojer commented Feb 4, 2020

there isn't much you can do, unfortunately, as mbedtls is a closed library in mos.
once 2.17 is out (soon), i think we can add a global setting, e.g. sys.cert_validity_check with possible values:

  • 0 - no cert validity check, i.e. current behavior (default)
  • 1 - check validity of certificates if wall time is set (i.e. mg_time() is something reasonable), otherwise allow.
  • 2 - always check validity of certificates, meaning all connection will fail until time is set

does this sound reasonable?

@JayNewstrom
Copy link
Author

This sounds great. Thanks!

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