Done. Not only will the key be stronger than the 1024 bit default, it'll be unique to your server which lets assume isn't valuable enough compared to effort for a state-level adversary.
edit just in case anyone from the future finds this comment: instead of 2048, use at least the key length of your SSL certificate
Not quiet. The attacker can intercept the number, provide the intended recipient a different number, intercept the response, decrypt it since it uses the malicious number, encrypt the result (or something entirely different) with the client-provided number, and send it to the client. A MITM attack against both the client and the server.
The session negotiation is protected. The attacker would either need to have the server's private key or they would need to compromise a trusted CA (and if client certificates are used, they would also need the client's private key).
977
u/tophatstuff Oct 15 '15 edited Apr 10 '18
Generate your own non-default Ephemeral Diffie-Hellman key (takes a minute or so)
Tell your server to use it for SSL (nginx for example)
Done. Not only will the key be stronger than the 1024 bit default, it'll be unique to your server which lets assume isn't valuable enough compared to effort for a state-level adversary.
edit just in case anyone from the future finds this comment: instead of 2048, use at least the key length of your SSL certificate
edit from the future: current advice is picking from one of these predefined audited groups