-
Notifications
You must be signed in to change notification settings - Fork 2
Support TLS Reject Unauthorized in config #94
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
Conversation
|
|
Yeah I was feeling lazy and didn't want to update them in all four places as we iterate on the changes. |
|
DP1 - Could we add a test that setting |
Is the concern that something unexpected would happen because it's a boolean value? I'm just trying to understand why it would be different from checking that the false value is added since the code for it doesn't differ between the two cases. |
… various config options for tls.
|
@Dtphelan1 I pushed up a new test for the various ways you could set I did change the functionality a little to only add the property if a boolean true or false is provided. I can easily swap back to setting any value if that seems preferred. Adding an unsupported value didn't see to harm anything and it just behaved like the default case ( |
|
I'm pleased with this approach! Great work as always JA! 🚀 🚀 🚀 🚀 🚀 🚀 |
|
I bonus added a brief section about masking patient data to the readme. Also, when this is approved, I will add equivalent sections to the other 3 repos for the new email config property, the masked patient data, and the new property in the example config files. |
18bf70b to
a5b43f5
Compare
mgramigna
left a comment
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.
Looks great and resolves the error for me confirmed
Summary
This supports setting TLS rejectUnauthorized through configuration.
New behavior
For some reason unknown to me, it doesn't appear that
nodemaileris usingNODE_EXTRA_CA_CERTSproperly, so if you are using that but don't haveNODE_TLS_REJECT_UNAUTHORIZED="0"set,nodemailerwould throw an error sayingunable to verify the first certificate. I couldn't figure out how to get theNODE_EXTRA_CA_CERTSto work properly withnodemailer, so instead this PR supports settingtls.rejectUnauthorizedfrom through a configuration fieldtlsRejectUnauthorized(I thought the flatter configuration structure was simpler). This is an optional configuration property. If it is left off,tls.rejectUnauthorizeddefaults totruewhen setting up the nodemailer transport, which is the behavior we would want by default.Code changes
Supports setting
tls.rejectUnauthorizedif it is in the config, checks that it is set properly in a test (the case that it is not set when not specified is tested implicitly by other tests), and adds information about using the property in the README.Testing guidance
If there are errors during extraction, you have
notificationInfoin your config file, you don't haveNODE_TLS_REJECT_UNAUTHORIZED="0"set, and you do haveNODE_EXTRA_CA_CERTSset, you should get an error when trying to send an email. If you add thetlsRejectUnauthorizedfield to your configuration, you should be able to send an email.Note: The README and example config changes here should be included in all the other repos, but I'll add them once they are reviewed and all set here. They should be exactly the same changes.