[PATCH 4/7] tls: Move certchain utilities to cert.c