tls: fix incorrect length for certificate message