-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Be able to set an SSL verify mode on faraday #982
Conversation
taquitos
commented
Jan 24, 2018
- addresses issue Can't set SSL verify mode in faraday options #981
- addresses issue #981
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.
Just a few bits of feedback, thanks @taquitos!
lib/octokit/default.rb
Outdated
# Default SSL verify mode from ENV | ||
# @return [String] | ||
def ssl_verify_mode | ||
ENV['OCTOKIT_SSL_VERIFY_MODE'] |
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.
So because most folks will not have this set, it will default to false which is a breaking change.
See https://github.com/lostisland/faraday/blob/923f90558c22326c9a757a7ff9dfb3a006d0abc8/lib/faraday/adapter/net_http.rb#L124-L130 for the implementation details
What do you think about doing something like this instead?
ENV.fetch("OCTOKIT_SSL_VERIFY_MODE") { true }
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.
That makes sense, totally forgot about defaults.
end | ||
conn = Octokit.client.send(:agent).instance_variable_get(:"@conn") | ||
expect(conn.ssl[:verify_mode]).to eq(OpenSSL::SSL::VERIFY_NONE) | ||
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 add a test here to ensure the expected default remains unchanged?
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.
Of course, good call
update spec to add default ssl value checking
Alright, all up-to-date 🎉 |
So great to see this merged 🎉 Thanks! |
This has been released as part of https://github.com/octokit/octokit.rb/releases/tag/v4.9.0 |
Awesome, thanks for keeping us posted 👍 |