Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 在新的OS X安装上安装Homebrew时出现问题(SSL错误)_Macos_Ssl_Github_Homebrew - Fatal编程技术网

Macos 在新的OS X安装上安装Homebrew时出现问题(SSL错误)

Macos 在新的OS X安装上安装Homebrew时出现问题(SSL错误),macos,ssl,github,homebrew,Macos,Ssl,Github,Homebrew,这里有一个新的OSX安装(新的VM),当尝试安装Homebrew时,我只得到一个SSL错误 fatal: unable to access 'https://github.com/Homebrew/homebrew/': Unknown SSL protocol error in connection to github.com:-9847 Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1

这里有一个新的OSX安装(新的VM),当尝试安装Homebrew时,我只得到一个SSL错误

fatal: unable to access 'https://github.com/Homebrew/homebrew/': Unknown SSL protocol error in connection to github.com:-9847
Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1
这是我正在使用的命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
检查了一下,尝试添加--unsecure(或-k)并从https中删除s,但似乎没有帮助。使用--unsecure,我刚刚发现服务器中止了SSL握手

有人知道这里出了什么问题吗?“xcode选择--安装”也已运行

编辑:按照下面的建议,我将使用tcpdump打包的文件转储到一个pcap文件中,并使用tshark打开该文件。从中我得到:

1 0.000000我的IP已删除->192.30.252.130 TCP 78 49451→443[SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=32 TSval=170479114 TSecr=0 SACK_PERM=1

2 0.128228192.30.252.130->MY_IP_已删除TCP 78 443→49451[SYN,ACK]序列=0 ACK=1 Win=14240 Len=0 MSS=1436 SACK\U PERM=1 TSval=2830778812 TSecr=170479114 WS=1024[以太网帧检查 顺序不正确]

3 0.128303我的IP已删除->192.30.252.130 TCP 66 49451→443[ACK]序列=1 ACK=1 Win=132416 Len=0 TSval=170479237 TSecr=2830778812

4 0.150128我的IP已删除->192.30.252.130 SSL 255客户你好

5 0.150913 192.30.252.130->我的IP已删除SSL 1158延续数据[以太网帧检查顺序不正确]
6 0.150916 192.30.252.130->81.26.52.196 TCP 64 443→49451[FIN,ACK]序列=1101 ACK=190 Win=4237312 Len=0[以太网帧检查序列 不正确]

7 0.150961我的IP已删除->192.30.252.130 TCP 66 49451→443[ACK]序列=190 ACK=1101 Win=131328 Len=0 TSval=170479257 TSecr=2830778812

8 0.150990我的IP已删除->192.30.252.130 TCP 66 49451→443[ACK]序列=190 ACK=1102 Win=131328 Len=0 TSval=170479257 TSecr=2830778812

9 0.151046我的IP已删除->192.30.252.130 TCP 66 49451→443[FIN,ACK]序列=190 ACK=1102 Win=132416 Len=0 TSval=170479257 TSecr=2830778812

10 0.151156 192.30.252.130->我的IP已删除TCP 64 443→49451[RST]序列=1102 Win=4237312 Len=0[以太网帧检查 顺序不正确]


如果这是一个干净的OS X安装,我怀疑这个问题可能是
SecureTransport
中的一个罕见问题(bug?),它可能是由到github的路径上某个地方的代理或防火墙设置触发的

您的
libcurl
是根据
Security.framework
编译的。错误代码
-9847
表示:

错误可能会精确定位到中的这一行。客户端似乎收到了一条长度意外的记录

它可能与类似的问题有关:

TLS连接和F5防火墙存在几个问题,以及 看起来是这样的。如果发生以下情况,该防火墙将终止TLS会话: 客户端hello在256到512字节之间。如果是这样的话,你 可以使用wireshark进行验证

我们在以后版本中采用的解决方案 gnutls的作用是添加填充:

您可以尝试使用tcpdump/wireshark进行进一步调查(将en0替换为您的接口名称):

在Wireshark中查看您的
pcap
文件(或直接在Wireshark中捕获),以获取每个阶段的详细信息。上的
SSL/TLS
有一个很好的解释。相比之下,我的(成功的)对话是这样的:

$ tshark -r test.pcap
  1   0.000000   10.0.0.125 -> 192.30.252.129 TCP 78 51229→443 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=32 TSval=235773429 TSecr=0 SACK_PERM=1
  2   0.133049 192.30.252.129 -> 10.0.0.125   TCP 74 443→51229 [SYN, ACK] Seq=0 Ack=1 Win=14240 Len=0 MSS=1460 SACK_PERM=1 TSval=1851779047 TSecr=235773429 WS=1024
  3   0.133148   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=1 Ack=1 Win=131744 Len=0 TSval=235773562 TSecr=1851779047
  4   0.138296   10.0.0.125 -> 192.30.252.129 SSL 255 Client Hello
  5   0.278168 192.30.252.129 -> 10.0.0.125   TLSv1.2 1490 Server Hello
  6   0.278567 192.30.252.129 -> 10.0.0.125   TLSv1.2 1490 Certificate
  7   0.278696   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=190 Ack=2849 Win=129632 Len=0 TSval=235773707 TSecr=1851779083
  8   0.278910 192.30.252.129 -> 10.0.0.125   TLSv1.2 399 Server Key Exchange
  9   0.278991   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=190 Ack=3182 Win=130720 Len=0 TSval=235773707 TSecr=1851779083
 10   0.339768   10.0.0.125 -> 192.30.252.129 TLSv1.2 141 Client Key Exchange
 11   0.551009 192.30.252.129 -> 10.0.0.125   TCP 66 443→51229 [ACK] Seq=3182 Ack=265 Win=15360 Len=0 TSval=1851779144 TSecr=235773767
 12   0.551185   10.0.0.125 -> 192.30.252.129 TLSv1.2 157 Change Cipher Spec, Encrypted Handshake Message
 13   0.688512 192.30.252.129 -> 10.0.0.125   TCP 66 443→51229 [ACK] Seq=3182 Ack=356 Win=15360 Len=0 TSval=1851779186 TSecr=235773977
 14   0.691643 192.30.252.129 -> 10.0.0.125   TLSv1.2 157 Change Cipher Spec, Encrypted Handshake Message
 15   0.691720   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=356 Ack=3273 Win=130976 Len=0 TSval=235774117 TSecr=1851779186
 16   0.692351   10.0.0.125 -> 192.30.252.129 TLSv1.2 215 Application Data
$ python -c "import urllib ; urllib.urlretrieve('https://raw.githubusercontent.com/Homebrew/install/master/install', 'install.rb')"
$ ruby install.rb


如果确实是这样的话,您的一个解决方法可能是使用
openssl
支持编译一个自定义
libcurl
,并让git使用新的
libcurl
。或者,您可以使用
ssh
而不是
https
连接到github(如果您在github注册了公钥)。

如果您只是想找到一个解决方法来安装自制软件,您可以尝试使用其他工具下载其安装脚本。例如,像这样:

$ tshark -r test.pcap
  1   0.000000   10.0.0.125 -> 192.30.252.129 TCP 78 51229→443 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=32 TSval=235773429 TSecr=0 SACK_PERM=1
  2   0.133049 192.30.252.129 -> 10.0.0.125   TCP 74 443→51229 [SYN, ACK] Seq=0 Ack=1 Win=14240 Len=0 MSS=1460 SACK_PERM=1 TSval=1851779047 TSecr=235773429 WS=1024
  3   0.133148   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=1 Ack=1 Win=131744 Len=0 TSval=235773562 TSecr=1851779047
  4   0.138296   10.0.0.125 -> 192.30.252.129 SSL 255 Client Hello
  5   0.278168 192.30.252.129 -> 10.0.0.125   TLSv1.2 1490 Server Hello
  6   0.278567 192.30.252.129 -> 10.0.0.125   TLSv1.2 1490 Certificate
  7   0.278696   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=190 Ack=2849 Win=129632 Len=0 TSval=235773707 TSecr=1851779083
  8   0.278910 192.30.252.129 -> 10.0.0.125   TLSv1.2 399 Server Key Exchange
  9   0.278991   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=190 Ack=3182 Win=130720 Len=0 TSval=235773707 TSecr=1851779083
 10   0.339768   10.0.0.125 -> 192.30.252.129 TLSv1.2 141 Client Key Exchange
 11   0.551009 192.30.252.129 -> 10.0.0.125   TCP 66 443→51229 [ACK] Seq=3182 Ack=265 Win=15360 Len=0 TSval=1851779144 TSecr=235773767
 12   0.551185   10.0.0.125 -> 192.30.252.129 TLSv1.2 157 Change Cipher Spec, Encrypted Handshake Message
 13   0.688512 192.30.252.129 -> 10.0.0.125   TCP 66 443→51229 [ACK] Seq=3182 Ack=356 Win=15360 Len=0 TSval=1851779186 TSecr=235773977
 14   0.691643 192.30.252.129 -> 10.0.0.125   TLSv1.2 157 Change Cipher Spec, Encrypted Handshake Message
 15   0.691720   10.0.0.125 -> 192.30.252.129 TCP 66 51229→443 [ACK] Seq=356 Ack=3273 Win=130976 Len=0 TSval=235774117 TSecr=1851779186
 16   0.692351   10.0.0.125 -> 192.30.252.129 TLSv1.2 215 Application Data
$ python -c "import urllib ; urllib.urlretrieve('https://raw.githubusercontent.com/Homebrew/install/master/install', 'install.rb')"
$ ruby install.rb

奇怪的看来你用对了。什么操作系统版本?如果您只是执行
git clone'https://github.com/Homebrew/homebrew/“
在临时目录中?@AndrewJanke fatal:无法访问“”:连接到github.com时出现未知SSL协议错误:-9847您正在使用哪些版本的OS X、
curl
git
?@AndrewJanke 10.10.3、7.37.1和2.3.2。我的本地计算机有相同的版本(但OS X的10.10.4 beta版),而且没有问题。那么,您是否在虚拟机中运行
Hackintosh
?其余的网络工作正常吗?这不会工作,因为脚本会再次尝试调用
git
。当然,你是对的。我没有注意到是git本身出了问题。只是这样做了,但我不确定我是否看到了这个特定的bug,或者它是其他什么东西。在我的原始问题中添加了输出,你能在@baf看一下吗?你能把第4帧和第5帧的内容,
客户端Hello
延续数据
发布到某处吗。您可以通过将
-V
选项添加到
tshark
命令行来获取详细信息。使用-r-V我得到“tshark:”test.pcap“既不是字段也不是协议名。”使用-V我得到“tshark:Invalid capture filter”test.pcap“用于接口‘以太网’!”@baf
tshark-V-r test.pcap
,请看下面是通过tshark使用-V-r:@baf运行后的整个输出