Skip to content
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

Faraday::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed #477

Open
hopewise opened this issue May 23, 2023 · 5 comments
Labels

Comments

@hopewise
Copy link

I am initializing my client as:

client = Slack::Web::Client.new(ca_path: "/home/deploy", ca_file: "cacert.pem")

where cacert.pem was downloaded from Mozilla here https://curl.se/docs/caextract.html

but I am still getting error:

client.chat_postMessage(channel:  @channel, text: "TEST", as_user: true)
Faraday::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed

Any idea? Kindly notice that certificate worked well with the slack-notifier gem which calls hooks.slack.com

@dblock dblock added the bug? label May 24, 2023
@dblock
Copy link
Collaborator

dblock commented May 24, 2023

I would first check whether https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/web/faraday/connection.rb#L17 is getting these options, just to be sure. Then reproduce just with Faraday directly.

@eftikharEmad
Copy link

@dblock I checked that and I can see the params I passed on this line https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/web/faraday/connection.rb#LL18C1-L18C1

Screen Shot 2023-06-05 at 5 32 46 PM

still get same error
Faraday::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify faile

@dblock
Copy link
Collaborator

dblock commented Jun 6, 2023

Reproduce with Faraday alone. I suspect it's the same problem, which means it's not an issue with the client itself (I don't know what the problem is though).

@gabifija
Copy link

I had the same error. As a fix, I passed params ca_path and ca_file directly: Slack::Web::Client.new ca_path: nil, ca_file: nil .
It should be save since it uses default cert store if the params are empty.
https://github.com/jruby/jruby-openssl/blob/968bff99a394cb53ab8388316c03c41f4e231015/lib/openssl/ssl.rb#L138

@dblock
Copy link
Collaborator

dblock commented Jun 17, 2024

@gabifija In slack-ruby-client 2.0 these were set to nil, see https://github.com/slack-ruby/slack-ruby-client/blob/master/UPGRADING.md#upgrading-to--200. Your issue is different, the OP is setting these to specific values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants