feat: add SSL/TLS certificate upload support - #145
Open
mabels wants to merge 1 commit into
Open
Conversation
starkillerOG
requested changes
Dec 11, 2025
starkillerOG
left a comment
Owner
There was a problem hiding this comment.
Looks good to me, some small tweaks and then this should be ready to go.
Out of curiosity, did you write this using AI?
Author
definitly. |
mabels
force-pushed
the
feature/certificate-upload
branch
from
December 12, 2025 07:28
22e98ea to
66a7963
Compare
Add certificate management methods to the Host class: - clear_certificates(): Clear existing certificates from device - update_certificate(): Update certificate and private key (overrides existing) This implementation simplifies certificate management for Reolink cameras and NVRs. Testing revealed that importing certificates automatically overrides existing ones, eliminating the need for a separate clear step in most workflows. Key improvements over initial implementation: - Fixed bug in clear_certificates() to use send_setting() instead of send() - Renamed import_certificate() to update_certificate() for clarity - Removed upload_certificate() as update_certificate() handles overrides - Proper error handling using ReolinkError exceptions - Base64 encoding of certificate and key content
mabels
force-pushed
the
feature/certificate-upload
branch
from
December 13, 2025 19:47
446defd to
7f98394
Compare
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.
Summary
This PR adds SSL/TLS certificate management functionality to reolink-aio, enabling automated certificate uploads to Reolink cameras and NVRs.
Changes
Added three new methods to the
Hostclass inreolink_aio/api.py:clear_certificates()- Clear existing SSL/TLS certificates from the deviceimport_certificate(cert_content, key_content, cert_name)- Import a new certificate and private keyupload_certificate(cert_content, key_content, cert_name, relogin_delay)- Complete workflow that orchestrates clearing, re-authentication, and importImplementation Details
API Commands Used
CertificateClear(action: 0) - Removes existing certificatesImportCertificate(action: 0) - Imports new certificate with base64-encoded dataLimitations & Notes
Testing
Tested successfully with:
Use Case
This functionality enables automated certificate management for Reolink devices, particularly useful for: