Curl Certificate Error when Using RVM to install Ruby 1.9.2

前端 未结 11 1547
太阳男子
太阳男子 2020-11-27 10:29

RVM is running into a certificate error when trying to download Ruby 1.9.2. It looks like curl is having a certificate issue but I am not sure how to bypass it

11条回答
  •  时光说笑
    2020-11-27 10:41

    On Centos 5.6 (Final) I had a problem with installing rvm 1.9.2 The error was:

    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    More details here: http://curl.haxx.se/docs/sslcerts.html
    
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). The default
     bundle is named curl-ca-bundle.crt; you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    ERROR: There was an error, please check /usr/local/rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
    Trying http:// URL instead.
    
    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
    More details here: http://curl.haxx.se/docs/sslcerts.html
    
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). The default
     bundle is named curl-ca-bundle.crt; you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    ERROR: There was an error, please check /usr/local/rvm/log/ruby-1.9.2-p290/*.log
    ERROR: There has been an error while trying to fetch the source.  
    Halting the installation.
    ERROR: There has been an error fetching the ruby interpreter. Halting the installation.
    

    Here is a list of actions which helped me to solve the problem

    $ curl-config --ca # show path to the certificate
    /usr/local/share/curl/curl-ca-bundle.crt
    $ cd /usr/local/share/curl/ # go to that path
    $ cp curl-ca-bundle.crt curl-ca-bundle.crt.bak # backup certificate
    $ curl http://curl.haxx.se/ca/cacert.pem -o curl-ca-bundle.crt # download new
    $ rvm install 1.9.2 # bingo it works
    

    Btw curl version is curl 7.18.0 (to check '$ curl -V')

提交回复
热议问题