Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Ruby 1.9.3 install external podspec #554

Closed
netbe opened this Issue Sep 24, 2012 · 18 comments

Comments

Projects
None yet
7 participants
Contributor

netbe commented Sep 24, 2012

Hi,

I've tried to install an external podspec hosted on github as a gist, and the install failed with the following error:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I've tried with Ruby 1.8.7 and it worked without any issues.

Thanks for your help

Owner

fabiopelosin commented Sep 25, 2012

I thought this was fixed. Are you on v0.14.0?

Contributor

netbe commented Sep 25, 2012

Yes, I'm on 0.14.0 and ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]

@ghost ghost assigned fabiopelosin Sep 28, 2012

Owner

alloy commented Oct 25, 2012

Ouch. That could be it. @netbe can you try it?

(Re-open if needed.)

@alloy alloy closed this Oct 25, 2012

Contributor

netbe commented Oct 30, 2012

@alloy I have tried, but still getting the same issue. I am using rbenv so I found a similar artice that the one mentioned by @glongman.
See http://coderwall.com/p/f4hyqw
How can I reopen this?

@alloy alloy reopened this Oct 31, 2012

Owner

alloy commented Oct 31, 2012

@netbe I’ve re-opened it, but – unless someone comes by that knows the answer – I don’t think we can do very much.

Just as a test, can you check if using SSL for anything else is broken as well on your 1.9 installation?

Contributor

netbe commented Oct 31, 2012

Sure, Do you have an example ? Some code I can run to test it out?

Envoyé de mon iPhone

Le 31 oct. 2012 à 16:12, Eloy Durán notifications@github.com a écrit :

@netbe I’ve re-opened it, but – unless someone comes by that knows the answer – I don’t think we can do very much.

Just as a test, can you check if using SSL for anything else is broken as well on your 1.9 installation?


Reply to this email directly or view it on GitHub.

Contributor

netbe commented Nov 2, 2012

@alloy I have tested my install, but not sure my test is relevant aka it works so that would mean the ruby 1.9.3 install is not faulty.
Checkout this code : https://gist.github.com/4000096

Owner

alloy commented Nov 2, 2012

Hmm, maybe the problem lies with open-uri. Can you try this:

» ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]

» irb
irb(main):001:0> require 'open-uri'
=> true
irb(main):002:0> puts open("https://raw.github.com/gist/3778049/6a066850b48e632a49a6e448b1591f6966160a88/dailymotion-sdk-objc.podspec").read
Pod::Spec.new do |s|
  s.name         = "dailymotion-sdk-objc"
  s.summary      = "Dailymotion Objective-C client API."
  s.homepage     = "http://www.dailymotion.com/doc/api/index.html"
  s.version      = "1.7"
  s.authors      = { "Olivier Poitrey" => "", "sparga" => ""}
  s.source       = { :git => "https://github.com/dailymotion/dailymotion-sdk-objc.git", :commit => "2e30c75f82adf2217d1a76450975c2ed9028861a" }

  s.ios.deployment_target = '3.0'
  s.osx.deployment_target = '10.8'

  s.source_files =  'Dailymotion.{h,m}','DailymotionPlayerViewController.{h,m}', 'DMBoundableInputStream.{h,m}' 
  s.public_header_files = 'Dailymotion.h', 'DailymotionPlayerViewController.h'

  s.framework  = 'Foundation'

  s.dependency 'SBJson'
end
Contributor

netbe commented Nov 2, 2012

Bingo, got the problem:

~% ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0]
~% irb
>> require 'open-uri'
=> true
>> puts open("https://raw.github.com/gist/3778049/6a066850b48e632a49a6e448b1591f6966160a88/dailymotion-sdk-objc.podspec").read
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799:in `connect'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799:in `connect'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/net/http.rb:744:in `start'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:306:in `open_http'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:775:in `buffer_open'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:677:in `open'
    from /Users/netbe/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:33:in `open'
    from (irb):2
    from /Users/netbe/.rbenv/versions/1.9.3-p194/bin/irb:12:in `<main>'>> 

Any solution? Do I have to reinstall ruby ?

Owner

alloy commented Nov 3, 2012

Hmm, you should be able to configure OpenSSL to not verify by default. I.e. add to the top of your Podfile:

require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

I do think something’s wrong with your installation, though. Maybe a RVM thing?

(Closing this for now.)

@alloy alloy closed this Nov 3, 2012

Owner

alloy commented Nov 11, 2012

Ok, I think I have found a solution for your problem. What needs to be done is:

  1. download a fresh set of CA certificates:

     $ [sudo] curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
    
  2. use those certificates to verify SSL connections by setting an env variable:

     $ export SSL_CERT_FILE /usr/local/share/cacert.pem
    

@netbe Can you try if that fixes it for you?

Owner

alloy commented Nov 11, 2012

For extra info, I had to do this after I needed to install a newer version of OpenSSL (through Homebrew) for Ruby 2.0.0-preview1.

Contributor

netbe commented Nov 11, 2012

@alloy thanks it worked!

Owner

alloy commented Nov 12, 2012

@netbe Cool, thanks for the update.

same problem, same solution, thank you.

sansari commented Sep 9, 2013

this issue also occurs with a fresh install of ruby 2.0.0 on a new machine. the solution above (#554 (comment)) worked for me as well! thanks @alloy :)

jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013

@orschaef orschaef referenced this issue in fastlane/fastlane May 6, 2015

Closed

Hockey upload fails with a SSL_connect error #258

ashokds commented Aug 2, 2016

@alloy, @netbe

Same issue, Just following hack worked, didn't need to download fresh certificates to get it running
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

~ $openssl version
OpenSSL 0.9.8zg 14 July 2015
~ $pod --version
1.0.1
~ $ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]

Now looking to get the right fix i.e. using fresh certificates.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment