Getting the peer certificate in a memory buffer - Openssl

This is a discussion on Getting the peer certificate in a memory buffer - Openssl ; Hi all,
How to get the peer certificate in a memory buffer during SSL connection
establishment ? Is there any API for this ?
Thanks in advance,
Waiting for your reply,
Aravind....