in reply to Embed TLS in plaintext XML

I don't think that any if the existing libraries gives you comfortable way to do this. At the end you have to fiddle around with various BIO_read, BIO_write and various other BIO_xxx methods. You might have a look at the source code of AnyEvent (especially AnyEvent::TLS and AnyEvent::Handle) to get the idea how this can be done.

Replies are listed 'Best First'.
Re^2: Embed TLS in plaintext XML
by Gukkifar (Initiate) on Nov 11, 2015 at 20:42 UTC

    I would much rather see the code that generates the TLS Hello, Exchange cipher, and Finished messages - and see how the magic is done.
    But I can't find those pieces of code anywhere? I've looked through Net::SSLeay, Crypt::SSLeay - but the missing link is... missing. At least for me.
    Especially the Net::SSLeay::connect seems interesting, but I can't find the code for that anywhere.

      The code to generate these messages is deep inside the OpenSSL library and you have no direct access from Perl to this and I doubt even there is a public C interface. But you can get the generated messages with a memory BIO and use of BIO_read, BIO_write etc. And again, on the Perl side AnyEvent will probably the best source to look into. You might have a look at code from other languages but I doubt that you will find much more because the use case you have is really special and weird.