git pod install 返回致命错误:SSL 证书问题?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20939105/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
pod install returns fatal error: SSL certificate issue?
提问by Mathieu
I just installed CocoaPods by following these instructions:
我刚刚按照以下说明安装了 CocoaPods:
Now I opened an Xcode project which has CocoaPods in it, I opened the terminal, went into that project folder and typed "pod install" as required, and I am getting an error back:
现在我打开了一个包含 CocoaPods 的 Xcode 项目,我打开了终端,进入了该项目文件夹并根据需要输入了“pod install”,我得到了一个错误:
$ pod install
Setting up CocoaPods master repo
[!] Pod::Executable clone 'https://github.com/CocoaPods/Specs.git' master
Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSL certificate problem: Invalid certificate chain
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:217:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:210:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
I have no idea what this is about. Can someone help me? This is the first time I try to do anything with CocoaPods on OS X Mavericks.
我不知道这是关于什么的。有人能帮我吗?这是我第一次尝试在 OS X Mavericks 上使用 CocoaPods 做任何事情。
Thanks!
谢谢!
回答by Aaron Brager
Github's SSL certificate looks fine from my end, but maybe you have distrusted it for some reason, or you are using a proxy. To resolve:
从我的角度来看,Github 的 SSL 证书看起来不错,但也许您出于某种原因不信任它,或者您正在使用代理。解决:
Using the Safari browser (not Chrome, Firefox or Opera) on Mac OS X 10.9 (Mavericks) visit https://github.com(no www.
).
在 Mac OS X 10.9 (Mavericks) 上使用 Safari 浏览器(不是 Chrome、Firefox 或 Opera)访问https://github.com(没有www.
)。
If an alert pops up, press the "Show Certificate" button, check "Always Trust", and then "Continue."
如果弹出警报,请按“显示证书”按钮,选中“始终信任”,然后“继续”。
If no alert pops up, press the green or gray Security button by the URL:
如果没有弹出警报,请按 URL 旁边的绿色或灰色安全按钮:
Then make sure "Always trust" is checked on the certificate.
然后确保在证书上选中“始终信任”。
If this doesn't resolve your issue, try temporarily disabling any proxy servers you might be running, such as Charles.
如果这不能解决您的问题,请尝试暂时禁用您可能正在运行的任何代理服务器,例如 Charles。
After that, pod install
should work.
之后,pod install
应该工作。
Note: A portion of my answer text was copied from this answer.
注意:我的部分答案是从这个答案中复制的。
回答by scope
Under the hood pod
uses just a regular git, so disabling SSL validation for git will solve the problem:
在后台pod
仅使用常规 git,因此禁用 git 的 SSL 验证将解决问题:
GIT_SSL_NO_VERIFY=true pod install
回答by Bhavik Modi
If you already have installed Cocoapods then write following code in terminal
如果您已经安装了 Cocoapods,请在终端中编写以下代码
sudo gem update
回答by xuefei zhao
when I run pod install, I encountered the problem : !] Pod::Executable clone 'https://github.com/CocoaPods/Specs.git' master
当我运行 pod install 时,我遇到了问题: !] Pod::Executable clone ' https://github.com/CocoaPods/Specs.git' master
Cloning into 'master'... fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSL certificate problem: Invalid certificate chain
克隆到“master”...致命:无法访问“ https://github.com/CocoaPods/Specs.git/”:SSL证书问题:证书链无效
And I finally resolved it by deleting expired certificates in keychains. When I open my terminal and run command pod install, it finally succeeded.
我最终通过删除钥匙串中的过期证书来解决它。当我打开终端并运行命令 pod install 时,它终于成功了。
Hope It helps
希望能帮助到你
回答by andreas-supersmart
My Digicert Certificate was twice in the keychain and the used one was invalid. Deleting the expired one did the job. Thanks for point me there!
我的 Digicert 证书在钥匙串中有两次,使用过的无效。删除过期的就可以了。谢谢你指出我在那里!