# 30117: Certificate cannot be parsed

Log Type: APPLICATION

Log Level: ERROR

## Description

Twilio returns this error when it can't parse the certificate you uploaded for a Link Shortening domain. Upload the certificate in PEM format and make sure the certificate content uses the expected PEM block structure.

### Possible causes

* The uploaded certificate data is corrupted, incomplete, or missing required content.
* The certificate is not in PEM format.
* The certificate does not start with `-----BEGIN CERTIFICATE-----` and end with `-----END CERTIFICATE-----`.
* The uploaded certificate includes extra newline characters at the beginning or end.
* If you use the API, the `TlsCert` value is not formatted correctly for the certificate upload request.

### Possible solutions

* Re-export or regenerate the certificate in PEM format, then upload it again.
* Confirm the certificate begins with `-----BEGIN CERTIFICATE-----` and ends with `-----END CERTIFICATE-----`.
* Remove any extra newline characters before the first line or after the last line of the certificate.
* If you upload the certificate through the API, send the `TlsCert` parameter in the required format. Include the concatenated certificate and private key value exactly as shown in the Link Shortening onboarding flow.
* If the upload still fails, generate a new certificate and private key pair and verify that the private key is also in the expected PEM format before retrying.

#### Additional resources

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