test: improve control flow in test-tls-dhe
If this test fails, e.g., if the s_client
output does not match the expectation, the previous implementation would not produce any helpful error messages. Rework the control flow to be more idiomatic. Avoid the 'exit'
event handler, unnecessary RegExp
, callback chaining, and stream operations. Also, the TLS server 'close'
event does not pass an error to the event handler, so remove the respective assertion.