github最近禁用了tls1.0加密协议,而此时mac系统上,旧版sublime,下载时会出现报错。查看sublime控制台报错信息:
Shell
Package info was unavailable last time crawler ran. Error downloading repository. HTTP exception InvalidCertificateException (Host api.github.com returned an invalid certificate ([SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:548))) downloading https://api.github.com/repos/rust-lang/sublime-rust.
1
Package info was unavailable last time crawler ran. Error downloading repository. HTTP exception InvalidCertificateException (Host api.github.com returned an invalid certificate ([SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:548))) downloading https://api.github.com/repos/rust-lang/sublime-rust.
然后查到:github的问题贴
简单来说就是,mac版sublime用的下载模块是urllib,而urllib是python自带的标准库,里面有ssl模块。而旧版python的ssl模块,采用ssl1.0连接服务器,所以导致高版本的ssl服务器拒绝连接。
解决办法是:打开sublime的
首选项 - >包设置 - >包控制 - >设置 - 用户
添加如下代码:【也就是知道下载模块的第一优先级是使用crul模块】
注意:要将"curl"放在第一项
“downloader_precedence”:
{
“osx”:
[
“curl”,
“urllib”,
“wget”
]
},
在linux里,类似
“downloader_precedence”:
{
“linux”:
[
“curl”,
“urllib”,
“wget”
]
},