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

OpenSSL::SSL::SSLError: SSL_write at Heroku #46

Closed
kokuyouwind opened this issue Dec 7, 2021 · 5 comments · Fixed by #47
Closed

OpenSSL::SSL::SSLError: SSL_write at Heroku #46

kokuyouwind opened this issue Dec 7, 2021 · 5 comments · Fixed by #47

Comments

@kokuyouwind
Copy link

At heroku, minimum app raises OpenSSL::SSL::SSLError: SSL_write .

# frozen_string_literal: true

ruby "2.7.4"
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# gem "rails"

gem 'ruboty-slack_rtm'
gem 'ruboty-redis'

Log


Dec 06 16:34:11 ruboty-lp app/bot.1 E, [2021-12-07T09:34:11.071481 #4] ERROR -- : OpenSSL::SSL::SSLError: SSL_write
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/ruby-2.7.4/lib/ruby/2.7.0/openssl/buffering.rb:322:in `syswrite'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/ruby-2.7.4/lib/ruby/2.7.0/openssl/buffering.rb:322:in `do_write'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/ruby-2.7.4/lib/ruby/2.7.0/openssl/buffering.rb:339:in `block in write'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/ruby-2.7.4/lib/ruby/2.7.0/openssl/buffering.rb:338:in `each'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/ruby-2.7.4/lib/ruby/2.7.0/openssl/buffering.rb:338:in `inject'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/ruby-2.7.4/lib/ruby/2.7.0/openssl/buffering.rb:338:in `write'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/bundle/ruby/2.7.0/gems/websocket-client-simple-0.3.0/lib/websocket-client-simple/client.rb:75:in `send'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/bundle/ruby/2.7.0/bundler/gems/ruboty-slack_rtm-8d81111cdd1f/lib/ruboty/slack_rtm/client.rb:72:in `block (2 levels) in keep_connection'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/bundle/ruby/2.7.0/bundler/gems/ruboty-slack_rtm-8d81111cdd1f/lib/ruboty/slack_rtm/client.rb:69:in `loop'
Dec 06 16:34:11 ruboty-lp app/bot.1 /app/vendor/bundle/ruby/2.7.0/bundler/gems/ruboty-slack_rtm-8d81111cdd1f/lib/ruboty/slack_rtm/client.rb:69:in `block in keep_connection'
Dec 06 16:34:11 ruboty-lp app/bot.1 connection closed.
Dec 06 16:34:13 ruboty-lp app/bot.1 activated.

I think these updates are related.

https://api.slack.com/changelog

November 2021
If you still use rtm.connect or rtm.start to connect to Slack, you'll notice that all WebSocket URLs now begin with wss://wss-primary.slack.com.
As previously announced, apps & integrations created after today, November 30, 2021, must use rtm.connect instead of the deprecated rtm.start when connecting to the RTM API. Learn more about this and what's next for existing users of rtm.start.

@ry023
Copy link

ry023 commented Dec 7, 2021

I met same problem and realized that the cause was probably shokai/websocket-client-simple.

I monkey patched this line as follows and it worked fine in my application.

@socket.hostname = uri.host
@socket.connect

hostname= method is used for SNI extensions. I expect that slack has probably changed their architectures and use SNI ...

@takaishi
Copy link

takaishi commented Dec 7, 2021

I met same problem too.
I tried to use slack-ruby-client instead of websocket-client-simple and slack-api, it looks like work well.

@linyows
Copy link
Contributor

linyows commented Dec 7, 2021

There was already a pull-request for SNI support here: shokai/websocket-client-simple#36

@unasuke
Copy link
Contributor

unasuke commented Dec 31, 2021

@kokuyouwind @ry023 @takaishi @linyows
Hello!!! SNI-supported websocket-client-simple was released!!! Could you try it?

@linyows
Copy link
Contributor

linyows commented Jan 1, 2022

Many thanks!

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

Successfully merging a pull request may close this issue.

5 participants