Subject: how to get back the original certificate from SSL structure ?

From: "M.Hanizan" <[email-masked]>
Date: Wed, 10 Apr 2002 19:57:36 +0800

Dear all :)

Is there anybody know how to convert SSL structure (or what so ever structure 
inside modssl and openssl source i.e X509 structure, BIO structure) back to 
its original certificate form. Or at least get the string (char array) format 
which content the encrypted data of the certificate.

So then I can put the string back to a file with certificate format as

-----BEGIN CERTIFICATE-----
$$$ the encrypted data $$$
-----END CERTIFICATE-----

This certificate I had installed it inside mybrowser, so it's not a file 
anymore!

Is there anybody know how to do it?

Thank you :)

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: "Alex Hong" <[email-masked]>
Date: Thu, 11 Apr 2002 11:20:58 +0800

Hi,

May be you can try to edit the "httpd.conf" and add the following line:
SSLOptions +ExportCertData
Then read the header information "SSL_SERVER_CERT" or "SSL_CLIENT_CERT"?

Regards,
Alex Hong.
--------------------------------------------------
Alex Hong
Software Engineer, New Paradigm e-Technology Ltd.
Email  : [email-masked]
Website: http://www.newparadigmgp.com
--------------------------------------------------

---

From: "M.Hanizan" <[email-masked]>
Date: Wed, 12 Jun 2002 12:02:30 +0800

Thanks... it really work :)

Inside ~ssl_engine_kernel.c~ in function ~void 
ssl_hook_NewConnection(conn_rec *conn)~, I added a line of :

rawcert = ssl_var_lookup(conn->pool, conn->base_server, conn, NULL, 
"SSL_CLIENT_CERT");

where rawcert is char * and conn is conn_rec *. Plus a small configuration 
inside httpd.conf as you suggested to me; SSLOptions +ExportCertData, the 
result is what I want.

This function will return the string as inside the certificate file.

Regards  :)
M.Hanizan