-
Notifications
You must be signed in to change notification settings - Fork 937
Add default certificate store when none given #1089
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
base: master
Are you sure you want to change the base?
Conversation
I'm not sure anymore what the default should be. I switched to just adding default cert store when neither Alternatively: Net::SMTP.default_ssl_context.tap do |context|
params = {}
params[:verify_mode] = openssl_verify_mode if openssl_verify_mode
params[:ca_path] = settings[:ca_path] if settings[:ca_path]
params[:ca_file] = settings[:ca_file] if settings[:ca_file]
context.set_params(params)
end |
a610aeb
to
3c53966
Compare
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.
Can we test this?
context.ca_file = settings[:ca_file] if settings[:ca_file] | ||
elsif openssl_verify_mode && openssl_verify_mode != OpenSSL::SSL::VERIFY_NONE | ||
context.cert_store = OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE | ||
end |
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.
Can we always set the cert store? Does it need to be mutually exclusive with provided CA path/file settings?
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.
Good question. Unfortunately I'm not sure myself. I based this off #set_params
which checks all three settings (including cert_store
itself).
References: