Mark wrote:
Hi
I'm pretty new to openssl.
I have some code that gets the certificate subject from the
X509_STORE_CTX as follows:
int my_func(int ok, X509_STORE_CTX *ctx)
{
char subject[256];
X509 *client_cert;
client_cert = X509_STORE_CTX_get_current_cert(ctx);
X509_NAME_oneline(X509_get_subject_name(client_cert), subject, 256);
instead of X509_NAME_oneline you should better use X509_NAME_print_ex
}
I'd like to do the same again at another place in the code but the
only structure I have available at that point is an SSL.
in case you want to have the peer certificate try
SSL_get_peer_certificate (or the same wirh _get_peer_cert_chain)
otherwise try SSL_get_certificate
Nils
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]