Skip to content

reolink(nvr): add HTTPS option for the NVR/Hub api.cgi connection#2069

Open
SnoElement wants to merge 1 commit into
koush:mainfrom
SnoElement:reolink-https-api-option
Open

reolink(nvr): add HTTPS option for the NVR/Hub api.cgi connection#2069
SnoElement wants to merge 1 commit into
koush:mainfrom
SnoElement:reolink-https-api-option

Conversation

@SnoElement

@SnoElement SnoElement commented Jun 21, 2026

Copy link
Copy Markdown

Fixes #2071.

Problem

The Reolink Home Hub and Home Hub Pro serve their api.cgi control endpoint over HTTPS only (typically port 443). The Reolink NVR client currently hardcodes http:// for every api.cgi call, so these hubs can't be added or managed.

Change

Adds an opt-in HTTPS control-path for the NVR/Hub api.cgi connection, preserving HTTP defaults for existing devices:

  • A per-device "Use HTTPS" advanced setting (default off), plus the same toggle in the add-device flow.
  • The scheme is threaded through ReolinkNvrClient as a proper ReolinkProtocol = 'http' | 'https' union and used by every api.cgi request — including the login/token bootstrap in probe.ts (getLoginParameters / getDeviceInfo), which previously always used http://.
  • Scheme-aware port default: httpPort || (https ? 443 : 80). The httpPort field no longer hard-defaults to 80; its onPut clears a stale other-scheme default (80↔443) so toggling HTTPS doesn't get stuck on :80, while a genuinely custom port is preserved.
  • The HTTPS setting description is shared between the creator form and the device settings so the two can't drift.

Validation

We made these changes to get the plugin working on our own setup — a Reolink Home Hub Pro — and have confirmed success in day-to-day use:

  • Verified on a real Home Hub Pro: hub-info fetch and login succeed over HTTPS (0 EPROTO).
  • Backward compatibility verified end to end: the default stays HTTP, and the standalone camera path is untouched (HTTP-only).

Note

The HTTPS option applies to the NVR/Hub flow; standalone cameras remain HTTP.

🤖 Generated with Claude Code

The NVR/Hub client hardcodes http:// for every api.cgi request. The Reolink
Home Hub and Home Hub Pro only serve their API over HTTPS, so the plugin
cannot connect to them (login, GetEvents polling, snapshots, PTZ, etc. all
fail against http://host:443).

Add a per-device "Use HTTPS" toggle (Advanced), surfaced both on the NVR
add-device form and on the NVR device settings, and thread it through
ReolinkNvrClient as a constructor flag that selects the URL scheme. Defaults
to HTTP, so existing cameras and NVRs are unaffected; the add-device port
default switches to 443 when HTTPS is selected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@koush

koush commented Jun 23, 2026

Copy link
Copy Markdown
Owner

@apocaliss92

@apocaliss92

Copy link
Copy Markdown
Contributor

I don't think it's true that the hubs work only on https, it's just a setting. I would remove the comment stating this and also adding an additional setting for the https port, since both will still be available

@koush

koush commented Jun 24, 2026

Copy link
Copy Markdown
Owner

I don't think it's true that the hubs work only on https, it's just a setting. I would remove the comment stating this and also adding an additional setting for the https port, since both will still be available

yeah thats what I think too. can you confirm @SnoElement

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

Successfully merging this pull request may close these issues.

Reolink Home Hub / Home Hub Pro can't be added — api.cgi is HTTPS-only

3 participants