You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get ssl_cacert error -> Peer certificate cannot be authenticated with known CA certificates
Started GET "/" for 127.0.0.1 at 2019-02-23 17:42:55 +0000
Processing by HelloController#index as HTML
ETHON: Libcurl initialized
ETHON: performed EASY effective_url=https://www.linkedin.com/ response_code=301 return_code=ssl_cacert total_time=0.123962
Rendering hello/index.html.erb within layouts/application
Rendered hello/index.html.erb within layouts/application (1.8ms)
Completed 200 OK in 406ms (Views: 273.2ms | ActiveRecord: 0.0ms)
Steps to Reproduce
Ruby: 2.6.0
Rails: 5.2.2
Windows 10 [Version 10.0.17134.590]
Freshly installed Ruby on Rails from railsinstaller.org
Created a fresh app using rails new myapp
Created a hello controller using rails g controller hello and added content
class HelloController < ApplicationController
def index
@easy = Ethon::Easy.new(url: "www.linkedin.com", followlocation: true)
@easy.perform
@response = @easy
# conn = Faraday.new(:url => 'https://www.linkedin.com')
# @response = conn.get '/'
@something = 'somethinghere'
end
end
Manually created a index.html.erb file in views with content
Tried the same with Faraday and did not get any errors: See the commented code in the controller. I had to change @response.response_body to @response.body in the views. Linkedin page was rendered.
But with ethon, I get ssl_cacert.
The text was updated successfully, but these errors were encountered:
Running the command pod install started failing a couple of days ago, seemingly for no reason, with the error mentioned in the issue title. cocoapods uses typhoeus under the hood, and I was able to reproduce the error using ethon.
Reproduction
require'net/http'require'pp'require'ethon'file_remote_url="https://wtfismyip.com/text"puts"trying with net/http:"putsNet::HTTP.get(URI(file_remote_url))puts"trying with Ethon:"easy=Ethon::Easy.new(url: file_remote_url)ifeasy.perform == :okputseasy.response_bodyelseppeasyend
Notably, using ethon does not cause a .pem file to be read.
Solution
It seems ethon was using a version of libcurl.dylib I had installed, last updated in 2014! I was able to force ethon to load the latest version of libcurl by removing my old version like so:
ssl_cacert error
I get
ssl_cacert
error -> Peer certificate cannot be authenticated with known CA certificatesSteps to Reproduce
Ruby: 2.6.0
Rails: 5.2.2
Windows 10 [Version 10.0.17134.590]
rails new myapp
hello
controller usingrails g controller hello
and added contentindex.html.erb
file inviews
with contentWhat I also tried
Tried the same with Faraday and did not get any errors: See the commented code in the controller. I had to change
@response.response_body
to@response.body
in the views. Linkedin page was rendered.But with
ethon
, I getssl_cacert
.The text was updated successfully, but these errors were encountered: