0

I am a total newbie which has started learning Ruby so please be patient with me. I am doing Ruby challenges where I need to run a Ruby file that launches a web server on my computer. First I run this application in command line with a command:

ruby app.rb

Then I paste this URL to my browser and access to my local server:

http://localhost:4567

On this local web page I click the link that gets connected to a web server on Internet where I should get authenticated. Till this moment everything works good, but during the authentication I have got an error. If there wasn’t any error during my authorization, the application would retrieve my profile data from the internet server. This is the error that I am getting:

Faraday::SSLError at /callback handshake alert: unrecognized_name.

I have been trying to resolve this problem for two days. What I have done:

1) I think this error is connected somehow with Java. I tried to run this application with all versions of Java (6, 7, 8) as people said they had the same problem when they updated to a higher java version. Unfortunately, my version of Ruby doesn’t accept Java 6.

2) Possible solution which was posted here SSL handshake alert: unrecognized_name error since upgrade to Java 1.7.0), the same as here in 20 similar posts in Stackoverflow about "handshake alert: unrecognized_name" error, where it is suggested to set the jsse.enableSNIExtension property. But I couldn’t understand any of those answers, specifically, where to apply this code. Then I found this link https://community.jivesoftware.com/docs/DOC-140837 where it was advised to open the Java Control Panel (I did it through System Preferences Java). I went through the Java tab and clicked View and added “-Djsse.enableSNIExtension=false” to the Runtime Parameters and applied it.

3) Another possible solution was found here Disable SNI Extension for Ruby net/http - Using IP address with SSL/TLS (the answer given by ZebGir) but I didn’t find the file *http.rb in my .rvm or even within my whole system.

Please advise any hint or link with the possible solution for my issue. My system is Mac OS X El Capitan. RVM version 1.27. Java version 1.8.

Community
  • 1
  • 1

1 Answers1

0

Have you tried disabling the ssl setting for your the faraday library? Something like:

connection = Faraday.new 'https://example.com', :ssl => false

Also see: https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates

darko
  • 2,438
  • 8
  • 42
  • 54
  • 1) I don't see any faraday library in all my system. Or maybe I'm doing something wrong? 2) I've checked the link which you've sent. I tried to change Faraday initializer to include this path as the ca_path variable but my folder /System/Library/OpenSSL/certs is empty. Within /System/Library/OpenSSL there are three directories and one file: /certs, /misc, /private and file openssl.cnf. I don't know where to put: connection = Faraday::Connection.new 'https://encrypted.google.com', :ssl => { :ca_path => "/usr/lib/ssl/certs" }. What did I misunderstand? – Wordworth Sep 27 '16 at 10:59