Is there an alternative in OpenSSL to SSL\_set\_connect\_state()/SSL\_set\_accept\_state() for X.509 certificate based authentication? 

The problem is that in my application the client and server do not communicate using sockets, and the establishment of direct connection between them is not possible. So what I want from OpenSSL is to 'expose' the intermediate SSL context establishment messages which I would then convey to the party at the other end. 

Thanks for your help!