reolink(nvr): add HTTPS option for the NVR/Hub api.cgi connection#2069
Open
SnoElement wants to merge 1 commit into
Open
reolink(nvr): add HTTPS option for the NVR/Hub api.cgi connection#2069SnoElement wants to merge 1 commit into
SnoElement wants to merge 1 commit into
Conversation
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>
Owner
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 |
Owner
yeah thats what I think too. can you confirm @SnoElement |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2071.
Problem
The Reolink Home Hub and Home Hub Pro serve their
api.cgicontrol endpoint over HTTPS only (typically port 443). The Reolink NVR client currently hardcodeshttp://for everyapi.cgicall, so these hubs can't be added or managed.Change
Adds an opt-in HTTPS control-path for the NVR/Hub
api.cgiconnection, preserving HTTP defaults for existing devices:ReolinkNvrClientas a properReolinkProtocol = 'http' | 'https'union and used by everyapi.cgirequest — including the login/token bootstrap inprobe.ts(getLoginParameters/getDeviceInfo), which previously always usedhttp://.httpPort || (https ? 443 : 80). ThehttpPortfield no longer hard-defaults to 80; itsonPutclears a stale other-scheme default (80↔443) so toggling HTTPS doesn't get stuck on:80, while a genuinely custom port is preserved.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:
EPROTO).Note
The HTTPS option applies to the NVR/Hub flow; standalone cameras remain HTTP.
🤖 Generated with Claude Code