ActiveCampaign/postmark-rails

Update default `http_ssl_version` - Similar issue to Postmark-gem

tonydehnke opened this issue ยท 5 comments

I'm running into an issue with Postmark-Rails and Heroku-20 Buildstack. After a bunch of searching around I found this issue in the postmark-Gem section of GitHub that is showing the same error:

SSL_connect returned=1 errno=0 state=error: no protocols available

Here is the issue:
ActiveCampaign/postmark-gem#86

It looks like there is an open PR for it:
ActiveCampaign/postmark-gem#92

I think we will need the same type of fix in postmark-rails

I was able to get it working using the temporary fix from 86, thanks to Sergio!

config.action_mailer.postmark_settings = { api_token: ENV['POSTMARK_TOKEN'], http_ssl_version: :TLSv1_2 }

This fix worked perfectly!

My report: I was unable to send emails, the log is full of OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: no protocols available). Just adding the http_ssl_version: :TLSv1_2 fixed this issue and my ActionMailer is back to work.

Thanks!

Hi @tonydehnke!

Apologies for the issues with SSL, I've just released a new version of the postmark gem(1.21.3) that no longer supplies a default SSL version and instead uses the default provided via OpenSSL. You can still specify a specific version if you'd like but it's no longer required, let us know if you have any issues! Going to close this for now but feel free to re-open it if needed.

@tonydehnke Forgot to mention it but since this is a patch release you should be able to just run bundle update postmark and it'll bump the version to 1.21.3.

Thanks.. I see know that postmark-rails has postmark as a dependancy, hadn't noticed that before.

I received this email
https://postmarkapp.com/updates/upcoming-tls-configuration-changes-for-api-users-action-may-be-required

I tested :

POSTMARK_API_KEY = 'mypostmarkapikey'
client = Postmark::ApiClient.new(POSTMARK_API_KEY, host: 'api-ssl-temp.postmarkapp.com')
client.deliver(from: "...", to: "...", text_body: 'test TLS')

Before updating the gem , the test failed with the message :
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: no protocols available

I just updated the gem : bundle update postmark-rails
...
Installing postmark 1.21.3 (was 1.15.0)
...
And then the test succeded :
{:error_code=>0, :message=>"OK"}
thanks to @nickhammond