Revise ssl code to use a CERT_PKEY structure when outputting a certificate chain instead of an X509 structure. This makes it easier to enhance code in future and the chain output functions have access to the CERT_PKEY structure being used.