-
-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not create a top level secureContext #1787
Conversation
This causes problems because the secureContext ends up being used by Haraka in server and client mode. Currently, the server mode loads TLS keys as part of the context in (plugins/tls_socket). The client mode does not load keys (in smtp_client.js). This discrepancy causes tls connections to fail when there is an incoming mail immediately followed by an outgoing mail.
Current coverage is 36.11% (diff: 0.00%)@@ master #1787 diff @@
==========================================
Files 22 22
Lines 5795 5792 -3
Methods 750 750
Messages 0 0
Branches 1454 1453 -1
==========================================
- Hits 2093 2092 -1
+ Misses 3702 3700 -2
Partials 0 0
|
This was the root cause for #1768. To reproduce this manually:
|
I think this is fine, but I'd like to test this before merging. I'll try to get that done tomorrow. |
|
||
secureContext = tls.createSecureContext(options); | ||
var secureContext = tls.createSecureContext(options); | ||
return secureContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well remove the variable declaration entirely and just return tls.createSecureContext(options);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Works for me too. Other than the one minor optimization I suggested, I'd be happy to merge this.
I've made the change in the PR. Do you agree @gramakri? |
@msimerson yes, OK with me, thanks! |
This causes problems because the secureContext ends up being used by
Haraka in server and client mode. Currently, the server mode loads
TLS keys as part of the context in (plugins/tls_socket). The client
mode does not load keys (in smtp_client.js). This discrepancy causes
tls connections to fail when there is an incoming mail immediately
followed by an outgoing mail.