How to fix annoying Zimbra certificate error after domain name change

Original: Regenerate the SSL certificate in a Zimbra single server environment.

This fix is for Standalone servers which use self-signed certificates on Zimbra 8.5+ which have following error:

ERROR: zclient.IO_ERROR (invoke sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, server: localhost) (cause: javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.ce
rtpath.SunCertPathBuilderException: unable to find valid certification path to requested target)

1. Create and deploy selsigned certificate – Run under root account:

[root@mail zimbra]# /opt/zimbra/bin/zmcertmgr createca -new

[root@mail zimbra]# /opt/zimbra/bin/zmcertmgr deployca

 

[root@mail zimbra]# /opt/zimbra/bin/zmcertmgr createcrt -new -days 365

[root@mail zimbra]# /opt/zimbra/bin/zmcertmgr deploycrt self

2. Verify Deployed certificate:

[root@mail zimbra]# /opt/zimbra/bin/zmcertmgr viewdeployedcrt

3. Restart Zimbra – run under zimbra account:

[root@mail zimbra]# su – zimbra

[zimbra@mail ~]$ zmcontrol restart