https://www.jianshu.com/p/a502eb72b689git
今天pod search 一個庫時發現搜索到的版本比github上的最新版本舊,因而採用下面的命令更新Cocoapods的庫github
pod repo update master --verbose
執行後卻報了下面的錯誤:ruby
Updating spec repo `master` [!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
這是爲什麼呢,明明不久前剛剛更新Cocoapods爲1.3.1版本啊。bash
搜索才發現是Github在不久以前的2018年2月23號移除了一些低加密標準協議,包括TLSv1/TLSv1.1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,相關連接在這裏:Weak cryptographic standards removedcurl
這就意味着Mac系統對應的openssl也須要更新。ui
這裏提供了升級辦法,搬運過來:this
$ which openssl /usr/bin/openssl $ openssl version OpenSSL 0.9.8zh 14 Jan 2016 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew update $ brew install openssl $ brew upgrade openssl `` If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile $ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile $ source ~/.bash_profile $ which openssl /usr/local/opt/openssl/bin/openssl $ openssl version OpenSSL 1.0.2n 7 Dec 2017 $ brew install rbenv ruby-build $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile $ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile $ source ~/.bash_profile $ rbenv install --list Available versions: 1.8.5-p52 1.8.5-p113 1.8.5-p114 1.8.5-p115 1.8.5-p231 1.8.6 : 2.1.0 2.1.1 2.1.2 : $ rbenv install 2.1.0 $ rbenv versions * system (set by /Users/username/.rbenv/version) 2.1.0 $ ruby --version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16] $ rbenv global 2.1.0 $ rbenv versions system * 2.1.0 (set by /Users/username/.rbenv/version) $ ruby --version ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin16.0] $ gem install cocoapods -n /usr/local/bin $ which pod /usr/local/bin/pod $ pod --version 1.4.0
完成上面一系列操做後,Cocoapods將會升級到最新的1.4.0版本。再執行pod repo update master --verbose
就沒有問題了。加密