Certificate
This API is partially documented or under construction.
Overview​
Synology DSM Core Certificate API Wrapper.
This class provides methods to interact with the Synology DSM Core Certificate API, allowing management of SSL certificates on a Synology NAS.
Parameters​
ip_address str
IP address or hostname of the Synology NAS.
port str
Port number to connect to.
username str
Username for authentication.
password str
Password for authentication.
secure bool
Use HTTPS if True, HTTP if False (default is False).
cert_verify bool
Verify SSL certificates (default is False).
dsm_version int
DSM version (default is 7).
debug bool
Enable debug output (default is True).
otp_code Optional[str]
One-time password for 2FA (default is None).
quickconnect_id str
QuickConnect ID for relay-based access. Defaults to None.
Methods​
list_cert​
List all certificates.
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict[str, object]
List of certificates.
set_default_cert​
Set a certificate as the default.
Internal API​
SYNO.Core.Certificate.CRT
Parameters​
cert_id str
Certificate ID to set as default.
Returns​
dict[str, object]
API response.
delete_certificate​
Delete one or more certificates.
Internal API​
SYNO.Core.Certificate.CRT
Parameters​
ids str or list[str]
Certificate ID or list of IDs to delete.
Returns​
dict[str, object]
API response.
upload_cert​
Upload a certificate to the Synology NAS.
Internal API​
SYNO.Core.Certificate
Parameters​
serv_key str
Path to the server key file (default is "server.key").
ser_cert str
Path to the server certificate file (default is "server.crt").
ca_cert Optional[str]
Path to the CA certificate file (default is None).
set_as_default bool
Set as default certificate after upload (default is True).
cert_id Optional[str]
Certificate ID to update (default is None).
desc Optional[str]
Description for the certificate (default is None).
Returns​
tuple[int, dict[str, object]]
HTTP status code and API response.
set_certificate_for_service​
Set a certificate for a specific DSM service.
Internal API​
SYNO.Core.Certificate.Service
Parameters​
cert_id str
Certificate ID to assign.
service_name str
Name of the service (default is "DSM Desktop Service").
Returns​
tuple[int, dict[str, object]]
HTTP status code and API response.
export_cert​
Export a certificate from the Synology NAS.
Internal API​
SYNO.Core.Certificate
Parameters​
cert_id str
The certificate ID to export. This can be found in the list_cert() method.
Returns​
Optional[BytesIO]
A BytesIO object containing the certificate archive, or None if export fails.
cert_crt_create​
Create a new SSL/TLS certificate or certificate signing request (CSR).
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict
API response with the created certificate/CSR details.
cert_crt_delete​
Delete a stored certificate or certificate signing request.
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict
API response confirming the deletion.
cert_crt_list​
List all SSL/TLS certificates and certificate signing requests.
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict
API response with the list of certificates and CSRs.
cert_crt_recreate​
Regenerate a certificate signing request (CSR) with new parameters.
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict
API response with the regenerated CSR details.
cert_crt_renew​
Renew an existing SSL/TLS certificate before expiration.
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict
API response with the renewed certificate details.
cert_crt_set​
Set a certificate as the default or configure its properties.
Internal API​
SYNO.Core.Certificate.CRT
Returns​
dict
API response confirming the certificate configuration.