Powered by eUKhost®

Announcement

Collapse
No announcement yet.

hostname was not match with the server certificate

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • hostname was not match with the server certificate

    Hi, I am setting up a rails application and when I deliver an email, i get this

    OpenSSL::SSL::SSLError in UsersController#forgot_password

    hostname was not match with the server certificate

    here is my setting

    ActionMailer::Base.raise_delivery_errors = true
    ActionMailer::Base.perform_deliveries = true
    ActionMailer::Base.delivery_method = :smtp

    ActionMailer::Base.smtp_settings = {
    :address => "localhost",
    ort => 25,
    :domain => "domain.com",
    :user_name => "[email protected]",
    assword => "pass",
    :authentication => :login
    }

    by not using any of the settings, only using sendmail, i am able to receive emails but its "From: " is not having proper domain.com ( it has the server name i have set in cpanel). Any help is much appreciated.
    for sale

  • #2
    Hello,

    Its not a error rather a warning message as SSL is hostname based.
    If you are using secure connection then you will need to use the SMTP server as servers's hostname i.e the actual hostname of server on which your domain is hosted. Also, secure SMTP port would be 465.

    Regards,
    NicK J.

    Comment


    • #3
      Hi,

      With the new versions of rails you now have to use the serverís host name as set in SSL certificate rather than using localhost I guess. Just as you have it here:

      :address => "localhost",

      Make sure to point your ActionMailer settings to use the serverís host name as set in the serverís SSL certificate.

      :address => íserver.ssl.nameí,

      while I cannot assure if this is a quick fix to it, but worth a try

      Let me know how you get on it.

      Sales: 0800 862 0380 || Skype: jenniferkent_uk

      Comment


      • #4
        jennifer

        I never had a ssl in my vps.

        thanks
        for sale

        Comment


        • #5
          Did you try replacing it with the server hostname or your domain name rather than using localhost?

          Sales: 0800 862 0380 || Skype: jenniferkent_uk

          Comment


          • #6
            Originally posted by jennifer View Post
            Did you try replacing it with the server hostname or your domain name rather than using localhost?
            I did try but it did not work. May be I have to install smtp-tls gem.?.
            for sale

            Comment


            • #7
              Hello,

              The problem is that enable_starttls_auto comes true by default so you will have to disable it, Please add following line in config.action_mailer.smtp_settings =

              :enable_starttls_auto => false
              Let me know if still you have a problem so I will check it further.
              Thanks and Regards,
              Alex Parker
              Senior System Administrator.
              Dedicated Hosting || Semi Dedicated Hosting|Disaster Recovery Solutions

              EMAIL:alex @ eukhost.com
              MSN: alex @ eukhost.com
              SKYPE: euk_alexp

              Comment


              • #8
                Originally posted by AlexP View Post
                Hello,

                The problem is that enable_starttls_auto comes true by default so you will have to disable it, Please add following line in config.action_mailer.smtp_settings =



                Let me know if still you have a problem so I will check it further.
                Alex, I tried that bit but rails threw an error as this setting is not recognised in rails 2.2.2. So, i had to hack action mailer. Now it works as expected.

                Thanks everyone for offering help.
                for sale

                Comment


                • #9
                  Is there anyway you could post here what are the exact changes you made to get it working? It would be good to know the fix for the next time

                  Thanks!

                  Sales: 0800 862 0380 || Skype: jenniferkent_uk

                  Comment


                  • #10
                    Absolutely Jenni

                    Open up the base.rb in ActionMailer and comment the following line:

                    smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)

                    for me, he was the troublemaker, so had to sort him with a #

                    cheers
                    for sale

                    Comment


                    • #11
                      aah thanks for posting the quick fix.

                      Alex was almost there... the trick is basically to turn off TLS with the current running mail server. So adding a code to disable it or commenting the enable_starttls line either should do to get this working..

                      Thank you for posting the fix.. much appreciated

                      Sales: 0800 862 0380 || Skype: jenniferkent_uk

                      Comment

                      ban-img
                      Working...
                      X