Senior & Expert RoR Developers Discussion Forum by Nyros Technologies

HIRE Ruby on Rails Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

OpenSSL::SSL::SSLError in Rails 2.2.2?

 
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> Experts Support & Chit Chat
View previous topic :: View next topic  
Author Message
juli



Joined: 07 Oct 2008
Posts: 22

PostPosted: Wed Jul 01, 2009 6:12 am    Post subject: OpenSSL::SSL::SSLError in Rails 2.2.2? Reply with quote

Hi all,

I have a web application hosting in a shared server. my web application is developed using Rails 2.2.2 version.The problem is that "in shared server they were upgrade to rails 2.3.2 and ruby 1.8.7". I am getting following error while sending mails from my application.

OpenSSL::SSL::SSLError in WikisController#invite_users
hostname was not match with the server certificate
......
.......

please anyone help me to solve this problem.

Thanks in advance,
juli.
Back to top
View user's profile Send private message
vijay



Joined: 08 May 2008
Posts: 63

PostPosted: Wed Jul 01, 2009 6:46 am    Post subject: OpenSSL::SSL::SSLError in Rails 2.2.2? Reply with quote

Hi juli,
I have a solution to your problem. The problem exit with the Ruby 1.8.7 Net::SMTP. Because smtp_settings of ActionMailer in Rails 2.3.2 will enable by default one more option called :enable_starttls_auto=>true. so that you are getting OpenSSL::SSL::SSLError.

Solution: Add the follwoing patch to your web application environment.rb file and restart your rails application.

if RAILS_GEM_VERSION == '2.2.2'
module ActionMailer
class Base

def perform_delivery_smtp(mail)
destinations = mail.destinations
mail.ready_to_send
sender = mail['return-path'] || mail.from

smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto)
smtp.start(smtp_settings[:domain], smtp_settings[:user_name], smtp_settings[:password],
smtp_settings[:authentication]) do |smtp|
smtp.sendmail(mail.encoded, sender, destinations)
end
end
end
end
else
raise "you forgot to remove the ActionMailer monkey patch!"
end



I think this may help you.

regards,
vijay
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> Experts Support & Chit Chat
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts Documentation
0 Anu 8 Thu Mar 18, 2010 4:01 am
Anu View latest post
No new posts File handling in ruby
0 Anu 18 Wed Mar 17, 2010 2:14 pm
Anu View latest post
No new posts sending an email from rb file
0 umamahesh_nyros 15 Wed Mar 17, 2010 6:13 am
umamahesh_nyros View latest post
No new posts difference bewteen render component and render partial
0 umamahesh_nyros 11 Wed Mar 17, 2010 6:06 am
umamahesh_nyros View latest post
No new posts Acts_as_tsearch plugin
0 swaminadhan 23 Sat Mar 13, 2010 9:10 am
swaminadhan View latest post
No new posts Built in classes in ruby
0 ktulasi 33 Thu Mar 11, 2010 1:09 pm
ktulasi View latest post
No new posts User defined classes and types of variables.
2 swaminadhan 51 Wed Mar 10, 2010 4:40 am
swaminadhan View latest post
No new posts Background & Introduction of ruby
0 Divya 49 Mon Mar 08, 2010 12:59 pm
Divya View latest post
No new posts i have lost the data in schema.rb file in rails application
0 Raja 57 Thu Mar 04, 2010 4:46 am
Raja View latest post
No new posts AlertPay
0 Raghu 37 Mon Mar 01, 2010 11:36 am
Raghu View latest post




Hire an expert Ruby on Rails developer / coder / programmer or development team from India now!!

Other Forums : PHP   ::   .Net   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About Ruby on Rails Experts   |   More