繁体   English   中英

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: 没有可用的协议

[英]OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: no protocols available

每当使用 rails 中的 postmark-mailer gem 触发任何邮件时都会收到此错误。

2022-09-13T12:03:19.061Z 45075 TID-osgak45wb PostmarkMailer::DeliveryJob JID-031252f83654da580e4d3fcf INFO: start
2022-09-13T12:03:19.192Z 45075 TID-osgak45wb PostmarkMailer::DeliveryJob JID-031252f83654da580e4d3fcf INFO: fail: 0.131 sec
2022-09-13T12:03:19.192Z 45075 TID-osgak45wb WARN: {"context":"Job raised exception","job":{"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"PostmarkMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"PostmarkMailer::DeliveryJob","job_id":"08138389-7cc8-4f0a-84c8-4cfbe0869cf4","provider_job_id":null,"queue_name":"mailers","priority":null,"arguments":[{]},\"track_opens\":\"true\",\"_aj_symbol_keys\":[\"from\",\"to\",\"template_id\",\"template_model\",\"track_opens\"]}],\"executions\":0,\"locale\":\"en\"}],\"retry\":true,\"jid\":\"031252f83654da580e4d3fcf\",\"created_at\":1663065224.6059873,\"enqueued_at\":1663070599.0592043,\"error_message\":\"SSL_connect returned=1 errno=0 state=error: no protocols available\",\"error_class\":\"OpenSSL::SSL::SSLError\",\"failed_at\":1663065241.922269,\"retry_count\":7,\"retried_at\":1663068011.4937775}"}
2022-09-13T12:03:19.192Z 45075 TID-osgak45wb WARN: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: no protocols available
2022-09-13T12:03:19.192Z 45075 TID-osgak45wb WARN: ~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:44:in `connect_nonblock'
2022-09-13T12:03:19.192Z 45075 TID-osgak45wb WARN: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: no protocols available
2022-09-13T12:03:19.192Z 45075 TID-osgak45wb WARN: ~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:44:in `connect_nonblock'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:44:in `ssl_socket_connect'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http.rb:996:in `connect'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http.rb:919:in `start'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http.rb:1470:in `request'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http.rb:1493:in `send_entity'
~/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/http.rb:1281:in `post'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/http_client.rb:30:in `block in post'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/http_client.rb:86:in `block in do_request'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/http_client.rb:85:in `synchronize'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/http_client.rb:85:in `do_request'
~.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/http_client.rb:30:in `post'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/api_client.rb:244:in `block in deliver_with_template'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/client.rb:39:in `with_retries'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/postmark-1.14.0/lib/postmark/api_client.rb:243:in `deliver_with_template'
~/.rvm/gems/ruby-2.6.4@orbidal/bundler/gems/postmark_mailer-152b64d07df2/lib/postmark_mailer/message_delivery.rb:13:in `deliver_now'
~/.rvm/gems/ruby-2.6.4@orbidal/bundler/gems/postmark_mailer-152b64d07df2/lib/postmark_mailer/delivery_job.rb:8:in `perform'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/activejob-5.1.6/lib/active_job/execution.rb:37:in `block in perform_now'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
~/.rvm/gems/ruby-2.6.4@orbidal/gems/i18n-1.1.1/lib/i18n.rb:284:in `with_locale'

这是您的 Ruby 和 OpenSSL 环境:

Ruby:           2.6.4p104 (2019-08-28 revision 67798) [x86_64-linux]
RubyGems:       3.0.3
Bundler:        2.2.25
Compiled with:  OpenSSL 1.1.1f  31 Mar 2020
Loaded version: OpenSSL 1.1.1f  31 Mar 2020
SSL_CERT_FILE:  /usr/lib/ssl/cert.pem
SSL_CERT_DIR:   /usr/lib/ssl/certs

With that out of the way, let's see if you can connect to rubygems.org…

Bundler connection to rubygems.org:       success ✅
RubyGems connection to rubygems.org:      success ✅
Ruby net/http connection to rubygems.org: success ✅

Hooray! This Ruby can connect to rubygems.org. You are all set to use Bundler and RubyGems.

Try to add this line: OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

在第 1 行的application_controller.rb文件中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM