API returning wrong public certificate?

Using Digital Ocean’s API, I’ve created database cluster ‘B’ from the restore point of database ‘A’, but have not been able to connect due to a self-signed certificate error.

I have pulled the certificate from the endpoint:{database B id}/ca

If I manually download the certificate from the dashboard, everything works, btw.

The endpoint appears to be returning the wrong certificate, because when I pull the certificate from database A, they are the same.

Comparing certificates downloaded from the dashboard confirms that they are different.

Is this the expected behaviour? How do I get the correct certificate for database B?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @ShuStudios

CA file you are getting from API is encoded. You will have to decode the file from Base64 format after removing quotes and brackets. You can decode the file by terminal or by online conversion.

Example :-

base64 -D ~/Downloads/ca-api > ~/Downloads/ca-cert 

You can also decode the file from below website :

I hope this helps.

Regards, Anadi