I'm trying to access a .NET service, using WS-Secureconversation. Specifically, WS-Trust for TLS handshake:

http://schemas.xmlsoap.org/ws/2005/02/trust/tls/WSTrustForTLS.pdf

It would be much easier if the service was located on a https endpoint.

All cpan modules I could find revolves around a socket and an endpoint that is ready to talk ssl, but that is not the case here. I need to wrap the TLS handshake and eventually application data in XML.

I've got the connection and XML under control, but need help with the contents of "BinaryExchange". A lot of modules already solved this, but they all require to take care of the tcp connection as well.


Can anyone help me to craft the TLS handshakes and encrypted application data, so I can wrap it in xml?


This is an example of the initial post that should be made from the client:


POST http://obfuscated.svc HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Host: obfuscated Content-Length: 1190 Expect: 100-continue Accept-Encoding: gzip, deflate Connection: Keep-Alive <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a= +"http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnde +rstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:A +ction><a:MessageID>urn:uuid:196ed237-3216-4b52-9304-beb62db9e103</a:M +essageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/a +nonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://obf +uscated.svc</a:To></s:Header><s:Body><t:RequestSecurityToken Context= +"uuid-e119489f-65ec-4609-9757-a284d3b0b5b3-1" xmlns:t="http://schemas +.xmlsoap.org/ws/2005/02/trust"><t:TokenType>http://schemas.xmlsoap.or +g/ws/2005/02/sc/sct</t:TokenType><t:RequestType>http://schemas.xmlsoa +p.org/ws/2005/02/trust/Issue</t:RequestType><t:KeySize>256</t:KeySize +><t:BinaryExchange ValueType=" http://schemas.xmlsoap.org/ws/2005/02/ +trust/tlsnego" EncodingType="http://docs.oasis-open.org/wss/2004/01/o +asis-200401-wss-soap-message-security-1.0#Base64Binary">FgMBAF4BAABaA +wFWHMqB2vOzZbm0ZHugS6WeW0uxqr6F89tcHCzaEzVutgAAGMAUwBMANQAvwArACQA4AD +IACgATAAUABAEAABkACgAGAAQAFwAYAAsAAgEAACMAAP8BAAEA</t:BinaryExchange> +</t:RequestSecurityToken></s:Body></s:Envelope>

In reply to Embed TLS in plaintext XML by Gukkifar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.