分享

gem install bundler SSL证书错误 解决办法

 雨夜的博客 2021-09-13

最近在windows10电脑上装上PentestBox后,直接用“msfconsole”命令启动metasploit时,却发现需要先让我执行ruby中的“gem install bundler”命令,意思是先让我安装一个bundler,结果却报了如下错误:

ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted storeERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted storeERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted storeERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://gems./ - SSL_connect retu ned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certi icate) (https://gems./specs.4.8.gz)ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted storeERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted store

file

解决办法

正常情况下,你是不会遇到 SSL 证书错误的,除非你的 Ruby 安装方式不正确。

如果遇到 SSL 证书问题,你又无法解决。

Linux上,请修改 ~/.gemrc 文件,增加 ssl_verify_mode: 0 配置,以便于 RubyGems 可以忽略 SSL 证书错误。

windows上, .gemrc 存放在: c:\用户\你的账户 下面,也就是类似于:C:\Users\fujie下面。

以下是我修改成功后再去执行“gem install bundler”命令的结果,以下结果,说明安装成功了,已经解决了这个SSL证书ERROR的问题。

ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted storeFetching: bundler-2.0.1.gem (100%)Successfully installed bundler-2.0.1(已成功安装bundler-2.0.1)Parsing documentation for bundler-2.0.1(解析bundler-2.0.1的文档)Installing ri documentation for bundler-2.0.1(安装bundler-2.0.1的ri文档)Done installing documentation for bundler after 5 seconds(5秒后完成为bundler安装文档)1 gem installed

file

注意:

如果你操作此步骤后已经成功后,再去执行“msfconsole“,你会发现照样启动不了。还是提示需要你安装bundler(gem install bundler),还出现这个问题多半的原因是因为你的电脑上还装有其它版本的ruby,你可以看一下你的ruby版本是否是用的PentestBox里面的ruby?(cmd窗口执行:ruby -v );如果不是,请自我修改。

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多