How to fix 'OpenSSL::SSL::SSLError' error in Ruby?












0















I use CloudFlare Flexible SSL certificate.



When I try send user registration confirmation, I receive 500 error. In log:




OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol):




My production.rb:



config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
tls: true,
address: 'smtp.yandex.ru',
port: 587,
domain: 'yandex.ru',
authentication: 'plain',
user_name: 'admin@site.ru',
password: 'password',
}


How can I fix this error?










share|improve this question

























  • Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)

    – Aaditya Maheshwari
    Jan 1 at 23:17













  • I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.

    – Artem
    Jan 1 at 23:23











  • I meant set up SSL for puma or whatever rails server you are using.

    – Aaditya Maheshwari
    Jan 1 at 23:25











  • I do not have certificate files because the CloudFlare does not issue them

    – Artem
    Jan 1 at 23:40






  • 1





    This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.

    – Synchro
    Jan 2 at 9:03
















0















I use CloudFlare Flexible SSL certificate.



When I try send user registration confirmation, I receive 500 error. In log:




OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol):




My production.rb:



config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
tls: true,
address: 'smtp.yandex.ru',
port: 587,
domain: 'yandex.ru',
authentication: 'plain',
user_name: 'admin@site.ru',
password: 'password',
}


How can I fix this error?










share|improve this question

























  • Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)

    – Aaditya Maheshwari
    Jan 1 at 23:17













  • I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.

    – Artem
    Jan 1 at 23:23











  • I meant set up SSL for puma or whatever rails server you are using.

    – Aaditya Maheshwari
    Jan 1 at 23:25











  • I do not have certificate files because the CloudFlare does not issue them

    – Artem
    Jan 1 at 23:40






  • 1





    This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.

    – Synchro
    Jan 2 at 9:03














0












0








0








I use CloudFlare Flexible SSL certificate.



When I try send user registration confirmation, I receive 500 error. In log:




OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol):




My production.rb:



config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
tls: true,
address: 'smtp.yandex.ru',
port: 587,
domain: 'yandex.ru',
authentication: 'plain',
user_name: 'admin@site.ru',
password: 'password',
}


How can I fix this error?










share|improve this question
















I use CloudFlare Flexible SSL certificate.



When I try send user registration confirmation, I receive 500 error. In log:




OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol):




My production.rb:



config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
tls: true,
address: 'smtp.yandex.ru',
port: 587,
domain: 'yandex.ru',
authentication: 'plain',
user_name: 'admin@site.ru',
password: 'password',
}


How can I fix this error?







ruby-on-rails ruby






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 8:59









Synchro

18.6k85371




18.6k85371










asked Jan 1 at 23:10









ArtemArtem

206




206













  • Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)

    – Aaditya Maheshwari
    Jan 1 at 23:17













  • I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.

    – Artem
    Jan 1 at 23:23











  • I meant set up SSL for puma or whatever rails server you are using.

    – Aaditya Maheshwari
    Jan 1 at 23:25











  • I do not have certificate files because the CloudFlare does not issue them

    – Artem
    Jan 1 at 23:40






  • 1





    This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.

    – Synchro
    Jan 2 at 9:03



















  • Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)

    – Aaditya Maheshwari
    Jan 1 at 23:17













  • I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.

    – Artem
    Jan 1 at 23:23











  • I meant set up SSL for puma or whatever rails server you are using.

    – Aaditya Maheshwari
    Jan 1 at 23:25











  • I do not have certificate files because the CloudFlare does not issue them

    – Artem
    Jan 1 at 23:40






  • 1





    This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.

    – Synchro
    Jan 2 at 9:03

















Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)

– Aaditya Maheshwari
Jan 1 at 23:17







Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)

– Aaditya Maheshwari
Jan 1 at 23:17















I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.

– Artem
Jan 1 at 23:23





I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.

– Artem
Jan 1 at 23:23













I meant set up SSL for puma or whatever rails server you are using.

– Aaditya Maheshwari
Jan 1 at 23:25





I meant set up SSL for puma or whatever rails server you are using.

– Aaditya Maheshwari
Jan 1 at 23:25













I do not have certificate files because the CloudFlare does not issue them

– Artem
Jan 1 at 23:40





I do not have certificate files because the CloudFlare does not issue them

– Artem
Jan 1 at 23:40




1




1





This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.

– Synchro
Jan 2 at 9:03





This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.

– Synchro
Jan 2 at 9:03












1 Answer
1






active

oldest

votes


















0














This error usually occurs if you try to establish an encrypted connection to a server that doesn't expect this. Port 587 typically requires the use of STARTTLS after first establishing an unecrypted connection. Try removing tls: true in your configuration and using enable_starttls_auto: true instead.






share|improve this answer
























  • It did not help, the error continues to appear :(

    – Artem
    Jan 2 at 13:48











  • Could you add a longer excerpt from your log? Is there a backtrace by any chance?

    – milgner
    Jan 2 at 15:27











  • Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

    – Artem
    Jan 2 at 16:21











  • This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

    – milgner
    Jan 3 at 18:32











  • The problem was that a completely different mail was used at devise.rb, changing it all worked.

    – Artem
    Jan 4 at 11:44













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999654%2fhow-to-fix-opensslsslsslerror-error-in-ruby%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This error usually occurs if you try to establish an encrypted connection to a server that doesn't expect this. Port 587 typically requires the use of STARTTLS after first establishing an unecrypted connection. Try removing tls: true in your configuration and using enable_starttls_auto: true instead.






share|improve this answer
























  • It did not help, the error continues to appear :(

    – Artem
    Jan 2 at 13:48











  • Could you add a longer excerpt from your log? Is there a backtrace by any chance?

    – milgner
    Jan 2 at 15:27











  • Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

    – Artem
    Jan 2 at 16:21











  • This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

    – milgner
    Jan 3 at 18:32











  • The problem was that a completely different mail was used at devise.rb, changing it all worked.

    – Artem
    Jan 4 at 11:44


















0














This error usually occurs if you try to establish an encrypted connection to a server that doesn't expect this. Port 587 typically requires the use of STARTTLS after first establishing an unecrypted connection. Try removing tls: true in your configuration and using enable_starttls_auto: true instead.






share|improve this answer
























  • It did not help, the error continues to appear :(

    – Artem
    Jan 2 at 13:48











  • Could you add a longer excerpt from your log? Is there a backtrace by any chance?

    – milgner
    Jan 2 at 15:27











  • Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

    – Artem
    Jan 2 at 16:21











  • This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

    – milgner
    Jan 3 at 18:32











  • The problem was that a completely different mail was used at devise.rb, changing it all worked.

    – Artem
    Jan 4 at 11:44
















0












0








0







This error usually occurs if you try to establish an encrypted connection to a server that doesn't expect this. Port 587 typically requires the use of STARTTLS after first establishing an unecrypted connection. Try removing tls: true in your configuration and using enable_starttls_auto: true instead.






share|improve this answer













This error usually occurs if you try to establish an encrypted connection to a server that doesn't expect this. Port 587 typically requires the use of STARTTLS after first establishing an unecrypted connection. Try removing tls: true in your configuration and using enable_starttls_auto: true instead.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 2 at 11:48









milgnermilgner

4,18911826




4,18911826













  • It did not help, the error continues to appear :(

    – Artem
    Jan 2 at 13:48











  • Could you add a longer excerpt from your log? Is there a backtrace by any chance?

    – milgner
    Jan 2 at 15:27











  • Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

    – Artem
    Jan 2 at 16:21











  • This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

    – milgner
    Jan 3 at 18:32











  • The problem was that a completely different mail was used at devise.rb, changing it all worked.

    – Artem
    Jan 4 at 11:44





















  • It did not help, the error continues to appear :(

    – Artem
    Jan 2 at 13:48











  • Could you add a longer excerpt from your log? Is there a backtrace by any chance?

    – milgner
    Jan 2 at 15:27











  • Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

    – Artem
    Jan 2 at 16:21











  • This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

    – milgner
    Jan 3 at 18:32











  • The problem was that a completely different mail was used at devise.rb, changing it all worked.

    – Artem
    Jan 4 at 11:44



















It did not help, the error continues to appear :(

– Artem
Jan 2 at 13:48





It did not help, the error continues to appear :(

– Artem
Jan 2 at 13:48













Could you add a longer excerpt from your log? Is there a backtrace by any chance?

– milgner
Jan 2 at 15:27





Could you add a longer excerpt from your log? Is there a backtrace by any chance?

– milgner
Jan 2 at 15:27













Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

– Artem
Jan 2 at 16:21





Now error: Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user.

– Artem
Jan 2 at 16:21













This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

– milgner
Jan 3 at 18:32





This means that your mailer is trying send from an invalid source address. Try adding default from: 'youraccount@example.com', using your yandex.ru mail address.

– milgner
Jan 3 at 18:32













The problem was that a completely different mail was used at devise.rb, changing it all worked.

– Artem
Jan 4 at 11:44







The problem was that a completely different mail was used at devise.rb, changing it all worked.

– Artem
Jan 4 at 11:44






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999654%2fhow-to-fix-opensslsslsslerror-error-in-ruby%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas