-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Fix to support windows #164
Changes from 5 commits
e532183
a91d407
db1633e
e7a4a06
6ad9030
abe698e
a2c0890
f5f2f75
1d099b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
### 0.9.2 (Next) | ||
|
||
* [#163](https://github.com/slack-ruby/slack-ruby-client/pull/164): Use `OpenSSL::X509::DEFAULT_CERT_DIR` and `OpenSSL::X509::DEFAULT_CERT_FILE` for default ca_cert and ca_file [@leifcr](https://github.com/leifcr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this in the same format as everything else, needs a |
||
* [#161](https://github.com/slack-ruby/slack-ruby-client/pull/161): Added support for cursor pagination - [@dblock](https://github.com/dblock). | ||
* Your contribution here. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
begin | ||
require 'openssl' | ||
rescue LoadError # rubocop:disable Lint/HandleExceptions | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is a great place to put this, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dblock Agree. Will move it there. |
||
|
||
module Slack | ||
module Web | ||
module Config | ||
|
@@ -21,8 +26,8 @@ module Config | |
def reset | ||
self.endpoint = 'https://slack.com/api/' | ||
self.user_agent = "Slack Ruby Client/#{Slack::VERSION}" | ||
self.ca_path = `openssl version -a | grep OPENSSLDIR | awk '{print $2}'|sed -e 's/\"//g'` | ||
self.ca_file = "#{ca_path}/ca-certificates.crt" | ||
self.ca_path = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_DIR : nil | ||
self.ca_file = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_FILE : nil | ||
self.token = nil | ||
self.proxy = nil | ||
self.logger = nil | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ def connection | |
|
||
options[:headers]['User-Agent'] = user_agent if user_agent | ||
options[:proxy] = proxy if proxy | ||
options[:ssl] = { ca_path: ca_path, ca_file: ca_file } | ||
options[:ssl] = { ca_path: ca_path, ca_file: ca_file } unless ca_path.nil? || ca_file.nil? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be tricky. Do both options have to be specified? Can't just one do the trick? I think one certificate chain can work just fine as well as just the cert directory. So this could be nicer as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree. if ca_path || ca_file is better. And only one needs to be present. |
||
|
||
request_options = {} | ||
request_options[:timeout] = timeout if timeout | ||
|
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.
Put back the line, please.