# 30116: Certificate or private key or both are missing

Log Type: APPLICATION

Log Level: ERROR

## Description

This error occurs when you upload a TLS certificate for a Link Shortening domain and the upload doesn't include the certificate, the private key, or both. Upload the certificate and key in PEM format. If you use the REST API, the `TlsCert` value must contain the concatenated certificate and private key.

### Possible causes

* The upload includes only the certificate or only the private key.
* The certificate or private key isn't in PEM format.
* The uploaded content is missing the required PEM boundaries, such as `-----BEGIN CERTIFICATE-----`, `-----END CERTIFICATE-----`, `-----BEGIN PRIVATE KEY-----`, or `-----END PRIVATE KEY-----`.
* In Console, one of the upload fields was left empty. In the REST API, the `TlsCert` value doesn't include both items in a single payload.

### Possible solutions

* If you use Console, paste the TLS certificate into the certificate field and paste the private key into the private key field.
* If you use the REST API, set `TlsCert` to the concatenated certificate and private key.
* Confirm the certificate starts with `-----BEGIN CERTIFICATE-----` and ends with `-----END CERTIFICATE-----`. For the private key, verify it starts with `-----BEGIN PRIVATE KEY-----` and ends with `-----END PRIVATE KEY-----`, or upload a key in `PKCS #8` format.
* Remove extra newline characters at the beginning or end of the certificate and private key, then upload them again.

#### Additional resources

* [Link Shortening Onboarding Guide](/docs/messaging/features/link-shortening/onboarding-guide)
* [Link Shortening](/docs/messaging/features/link-shortening)
* [Alarms](/docs/usage/troubleshooting/alarms)
