# How to see Diffie Hellman private key used during negotiation? [closed]

I used OpenSSL s_client to connect to a test server.

Because OpenSSL generated client side private DH key, I think there will be a way to show the private key or enforce a specific private key to be used in negotiation for test purposes.

How can I do this?

## closed as off-topic by Maarten Bodewes♦, Ella Rose♦, e-sushiAug 31 '18 at 1:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Programming questions are off-topic even if you are writing or debugging cryptographic code. Unless your question is specifically about how the cryptographic algorithm, protocol or side-channel (mitigation) works, you should look into asking on Stack Overflow instead." – e-sushi
If this question can be reworded to fit the rules in the help center, please edit the question.

• I'm voting to close this question as off-topic because this is about the command line use of a cryptographic tool. Please ask on superuser instead. – Maarten Bodewes Aug 30 '18 at 1:52
• No, libssl won't show, or set, the ephemeral private key -- unless you intervene manually with a debugger, or change the source and rebuild which you can because it's open source. s_client does show the (derived) master secret for the session, which is sufficient to decrypt eavesdropped traffic; there are multiple Qs about that on security.SX and perhaps some other Stacks. – dave_thompson_085 Aug 31 '18 at 1:37
• Thanks a lot. Do you happen to know a tool that does show it? Debugging or rebuild is too complex for me. – Zeta Aug 31 '18 at 5:15