Saturday, December 21, 2013

SSL_read: wrong version number

I've been  getting this error with two parts of an application where I am using Action::Mailer. My certs are up-to-date, I have my configs set up seems that a lot of others are having the same problem, and I see a lot of "try this" answers to the problem, but no real answers. I see there are a lot of others who are getting the same error. I have tried almost all of the other answers out there without resolution.

My solution? I knew that a version of the application was working on an ubuntu server and it was not getting SSL errors in the ONE part of the app that has a mailer, but I needed to be able to see if 1) the SSL error was unique to this new part of the app, or to my machine, and 2) if the rest of this feature was at all functional, and I could not tell since I could not get beyond the SSL errors. So, I cloned my repo to an ubuntu instance I had running on AWS. It worked. Despite the cert updates on my machine, it turns out it was the cause of the SSL errors. I suspect it may be an OS X firewall issue, but I will look into that later. I'd rather be coding and building things.

One thing I needed to make sure I had set properly was this line in the config/environments/development.rb file:

             config.action_mailer.default_url_options = { host: "your server address" }

Since this is the address that the mailer uses to configure the link in the reset email, it needs to be able to find the password_resets/edit<authtoken> view on your server.

I'm not a security expert, but if you're having a similar error with a mailer -- especially using the mail_form gem or Ryan Bates' Password Reset episode, ping me!

No comments:

Post a Comment