2014-11-05 194 views
0

我已经用https建立了一个gem repo。我们拥有内部歌手证书,我拥有歌手/信任证书。使用Gem安装SSL证书错误

但是,在安装这些PEM文件,我不知道,所以想做一个创业板安装

我们使用CHEF时,因此使用作为厨师的客户端安装的一部分安装红宝石获得SSL错误。

有通过网络的唯一aswer人有一种变通方法,即从HTTPS更改为HTTP,但我想创业板的回购协议是建立与HTTPS(端口443)搜索

下面是错误我得到

[[email protected] ~]# /opt/chef/embedded/bin/gem install lvm 
ERROR: Could not find a valid gem 'lvm' (>= 0) in any repository 
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) 
    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://myself.mydomain.com/artifactory/simple/infra-automation/gem-repo/latest_specs.4.8.gz) 

使用Ruby试图remote_fetcher测试

/opt/chef/embedded/bin/ruby -rrubygems/remote_fetcher -e 'p Gem::RemoteFetcher.new.fetch_http(URI.parse("https://myself.mydomain.com/artifactory/simple/infra-automation/gem-repo/latest_specs.4.8.gz")).bytesize' 

UPDATE:

发现这个网上,这是我的默认PEM文件,更新这里的证书,但错误依然不会

/opt/chef/embedded/bin/ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE' 
/opt/chef/embedded/ssl/cert.pem 

回答

2

简单的解决方案可能是只设置SSL_CERT_FILE环境变量的CA证书文件。这应该由Ruby的OpenSSL层自动获取。

+0

谢谢,试过了,但没有工作。还是一样的错误 – Saurav 2014-11-05 22:22:01

0

我有同样的问题,认为这是公司代理,但我只需要更新rubygems。 你可能想从https://github.com/rubygems/rubygems/releases/

复制下载最新版本的红宝石宝石夹 ,然后在CMD

C:\>gem install --local C:\rubygems-update-1.8.30.gem 
C:\>update_rubygems --no-ri --no-rdoc 

希望帮助!