SSL Recovery is Broken

Hub model: C8-Pro

Platform version: 2.5.2.135

Apologies in advance for the lengthy story below. But this demonstrates multiple failures of what are supposed to be safeguards. These really need attention so they can actually work reliably...

I've finally recovered from a roller coaster of a night getting almost completely locked out of my hub. I have (had) a self-signed certificate and key uploaded to my hub for https (cert issued from my self-hosted instance of Step CA). Yes, I've trusted the root cert on my devices, and using the hub UI over HTTPS was working fine without issues (until I tried to upgrade). It was working well enough that I turned on the "force HTTPS" option.

My hub was previously (and is now again) running version 2.5.1.181. I did an update to 2.5.2.135, and after rebooting, I could no longer connect to the hub UI. Instead of loading the page, I got "ERR_SSL_PROTOCOL_ERROR" in Edge on Windows (and SEC_E_ILLEGAL_MESSAGE (0x80090326) via curl).

"No worries, I remember there's a safety URL path to disable HTTPS in case of emergencies", I thought. So I went to the forum and found the "http://your.hubs.ip.here/hub/advanced/disablessl" option. Cool, good to go, right? No. :frowning:

  • Visit the link in the browser: redirects back to HTTPS ".../login?loginRedirect=%2Fhub%2Fadvanced%2Fdisablessl" -- I'M STUCK
  • Try with curl - this redirects to HTTPS as well -- I'M STUCK
    • Specifically, http.../disablessl --> http.../login?loginRedirect=... --> HTTPS.../login?loginRedirect...

With all the different variations I tried (Windows browser, phone browser, private session browser, curl following redirects (-L), curl with no redirects, ...) I kept on trying to hit my hub ip with http after each try, and it still continued to redirect to HTTPS. No amount of fighting with the ".../disablessl" link did anything. HTTPS was stuck on.

So I finally went the route of visiting the hub diagnostic page. After a lot of "what else can I do before doing a soft reset?" thoughts, I finally just did a soft reset (after downloading a backup that I hoped didn't have my certificate included in it).

BUT: after doing a soft reset the first time - Nothing Changed!

The hub rebooted, I tried to load the hub UI, and... Redirect to HTTPS with SSL Protocol Error. What???

Back to diagnostic page - reboot hub - visit UI - SSL Error.

Back to diagnostic page - select backup to restore to (2.5.1.181) - restore finishes - hub reboots - visit UI - SSL Error.

Back to diagnostic page - soft reset AGAIN - hub reboots - visit UI - presented with a page that says "your database is corrupt - you must do a soft reset".

Hold on! A soft reset (after the first try failed) corrupted the database??

Ok, fine, click the button to soft reset a third time, wait for hub to reboot, and I finally have a hub that I can manage and restore my backup to (which, fortunately, was clear of the forced HTTPS setting).

So in the end, I want to report:

  • there is some scenario(s) in which a custom certificate, that is working initially, stops working
    • It's not clear to me what this scenario is yet. Is it simply rebooting? Is it something with the new platform version? Is it something with my certificate? Presence of an intermediate certificate in the chain? Something with the certificate key (e.g. algo choice)?
  • the disablessl endpoint doesn't work (or at least not in my situation).
  • soft resets via the diagnostic page are unreliable

Again, I apologize for the rant this probably sounds like, but I want to express the impact of these failures of safeguards. I'm also happy to help debug these issues further so (hopefully) no one else will need to fight this same battle. I'd also really like to confidently go back to using a cert from my private CA, and enforcing HTTPS, but I'm a bit concerned now.

I avoided all this by using NGINX with a wildcard cert from Let's Encrypt. So when I type in the URL associated with Hubitat, it proxies it through NGINX using SSL via NGINXs cert, which is already recognized by all my computers since it was issued by Let's Encrypt.

Tagging @support_team, since the OP is presumably not looking to simply abandon their self-signed CA in favor of letsencrypt.

Sounds like disablessl endpoint should not be behind the UI security filter. Thank you for bringing it to our attention, the next build will have the fix.

Also, please PM me the hub id, I'll check out what's going on with the soft reset.

That’s fair. I’ve previously used a reverse proxy for this purpose as well, but decided I preferred doing SSL directly to the hub so there was no dependency on another machine in the middle.

Awesome, thank you! I’ve PM’d the details.

I would also love to know (and help debug, if needed) what about my certificate (or key) that caused the SSL errors after it rebooted. It’s incredibly strange to me that it worked when I originally added it, but then stopped working after it upgraded (or rebooted).