Fix ssl_connection to support reading proxy/chain certificates