<div dir="ltr">Hi Victor, <div>Thanks for advising me and for the links.  </div><div>I'm learning a lot, despite the bad news ....</div><div><br></div><div>Thanks.</div><div><br></div><div>Kind regards</div><div><br></div><div>loredana</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mer 16 feb 2022 alle ore 15:30 Viktor Dukhovni <<a href="mailto:openssl-users@dukhovni.org">openssl-users@dukhovni.org</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Feb 16, 2022 at 11:16:03AM +0100, mary mary wrote:<br>
<br>
> But now the issue would become different, and I'll try to share it<br>
> possibly even if the subject changes, in case i could get advice.  I<br>
> needed the private key for adding it in wireshark for decoding some<br>
> encrypted messages exchanged between "my" server and a client.  If the<br>
> private key does not exist, how we could decode the messages?<br>
<br>
Well, now that we're past the XY problem, there's good news and bad<br>
news.<br>
<br>
Good news:<br>
<br>
    * If you control the server, the server's private key is typically<br>
      stored in the server's private key file (possible same as its<br>
      certificate file).  If the server is OpenSSL rather than Java<br>
      based, it would typically already be in PEM format, ...<br>
<br>
Bad news:<br>
<br>
    * Even with the server's private key, you generally can't decrypt TLS<br>
      traffic, when, as is typical and best-practice, the negotiated<br>
      cipher has forward-secrecy (uses DH or ECDH key exchange).<br>
<br>
To actually decode the traffic, you'd need to configure the server or<br>
client to record the session "master secret".  A client-side example<br>
is discussed in:<br>
<br>
    <a href="https://resources.infosecinstitute.com/topic/decrypting-ssl-tls-traffic-with-wireshark/" rel="noreferrer" target="_blank">https://resources.infosecinstitute.com/topic/decrypting-ssl-tls-traffic-with-wireshark/</a><br>
<br>
Alternatively, In the blog post at:<br>
<br>
    <a href="https://blog.didierstevens.com/2020/12/14/decrypting-tls-streams-with-wireshark-part-1/" rel="noreferrer" target="_blank">https://blog.didierstevens.com/2020/12/14/decrypting-tls-streams-with-wireshark-part-1/</a><br>
<br>
there's an example which downgrades the client TLS parameters to use at<br>
most TLS 1.2 and RSA key transport (instead of DH), which then makes it<br>
it possible to use the server's private key to decrypt the traffic.<br>
<br>
-- <br>
    Viktor.<br>
</blockquote></div>