title: How do I extract the pre-master secret using an OpenSSL-based client?
body: <p>I have an application I'm making that uses OpenSSL 1.0.2 and I'd like to examine the traffic with Wireshark. Wireshark can (allegedly) decrypt TLS conversations provided you give it the pre-master secret.</p>
  
  <p>If I'm using a cipher suite like <code>TLS_RSA_WITH_AES_256_CBC_SHA256</code>; can anyone tell me how to get the pre-master secret out of an <code>SSL</code> or <code>SSL_CTX</code> struct? I'm OK with hacking opaque structures within the <code>SSL</code> object - this isn't for anything that would ship in a product; I just want to know how to populate a pre-master secret file for Wireshark.</p>