When replacing the MACHINE_SSL certificate with an external certificate with embedded key through the vCenter web UI, an error is displayed: "TLS Certificate replacement failed : 0"
The cause of this error is that the leaf certificate or root chain certificate contains Windows line endings (CRLF) instead of Unix line endings (LF).
To resolve, ensure that the string value of the certificate is copied into a text editor with Unix line endings enforced. Then, copy the text from there or save the file as a .crt or .cer file. Provide the new value or file to the UI when replacing the certificate.
You can identify the line endings by reviewing the bottom toolbar in either Notepad ++ or Windows Notepad: