Get database TLS certificate
Get a database’s TLS file with GET /v2/databases//credentials/certificate: a base64 PEM with the private key and certificate.
GET
Get database TLS certificate
string
required
The API key for your account. You can find this in your account settings.
databases:credentials scope.
Returns the TLS file the database uses for encrypted connections, base64-encoded. Once decoded, it is a PEM with the private key followed by the certificate, ready to be written to a .pem file. Managed MongoDB, MySQL and PostgreSQL databases each ship with their own certificate; check your driver’s TLS options to see whether it needs one.
The database must be running when you call this, if it is stopped, start it first. To rotate the certificate instead of just reading it, use Reset Credentials with reset: "certificate", then re-fetch it here.
Parameters
string
required
The ID of the database.
Response
string
Indicates whether the call was successful:
success if it was, error if not.object
The contents of the response.
Common errors
Related
- CLI:
squarecloud db credentials certificate - SDKs:
api.databases.certificate()(JavaScript),client.databases.certificate()(Python),c.Databases.Certificate()(Go)

