brew updateが止まってしまう curl: (28) ssl connection timeout

いや、全く、困った。

自宅サーバから、https://〜に接続できなくなったのです。

妻とわたしが使っている機械では問題無し。

なんで?

サーバーだから、直接操作することはマレ、だが、時々、アップデートする必要があるのですな。

例えば、homebrew、brew updateコマンドが止まってしまう。

error: Operation timed out after 300039 milliseconds with 0 out of 0 bytes received while accessing https://github.com/mxcl/homebrew.git/info/refs

fatal: HTTP request failed

Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

裏で動いているコマンド、gitやcurlが止まっていることがわかるまでに3日。

例えば、
curl -O https://github.com/mxcl/homebrew.git/info/refs
が動かない。
ググると…opensslをチェックせよ、という…
例えば、次の2つを比べると…

openssl s_client -msg -connect encrypted.google.com:443
openssl s_client -msg -connect github.com:443
2つ目だけが止まるのだよ…なんで?
サーバー側の問題でしょうかね。ならば、打つ手が無い、ぐむう。試しに、「冗長モード」で稼働させてみると…

curl –verbose -O https://github.com/mxcl/homebrew.git/info/refs

ネゴシエーションで止まってしまう…確かに、サーバー側が答えてくれない…

さらに2日。

整理っっっっ
ttps://github.com/に対して、curlコマンドは、
curl: (28) ssl connection timeout
と言っている。
サーバー側が「お前は信用できない」と言っているのか、接続した側が「このサーバーは信用できない」と行っているのか、その両方か…

そもそも、curlは、どの証明書を使っているのだ?
MacPorts版を使っているので、
/opt/local/share/curl/
に入っているはず。

-rw-r–r–  1 root  admin  – 251338  5 19 23:37 curl-ca-bundle.crt
-rw-r–r–  1 root  admin  – 251342  4 15 15:35 curl-ca-bundle.crt.old
あれ?
日付が変わっていますね。
ちゃんと接続できるわたしの機械では…

-rw-r–r–   1 root  admin  251342  4 15 15:35 curl-ca-bundle.crt

そうそう、変わるはずが無い…でも、何故、誰が、書き換えたの?

むむむむむむむっ

それはそれとして…ハッキングの可能性は捨てきれないが…
日付が、2013/05/19、日曜日、多分、わたしでしょうね。
自分が何をしたのか、忘れた…やばいっす。

ちゃんと接続できるマシンからcurl-ca-bundle.crtをコピーして、

-rw-r–r–  1 root  admin  – 251342  4 15 15:35 curl-ca-bundle.crt
-rw-r–r–  1 root  admin  – 251342  4 15 15:35 curl-ca-bundle.crt.old
-rw-r–r–  1 root  admin  – 251338  5 19 23:37 curl-ca-bundle.crt_20130519

こんな感じ。

ぉおっ
curlが動くよっっっ

しかしながら、

openssl s_client -msg -connect github.com:443
の問題は解決せず…
ま、当面はよしとしておこう。
よしとしておかないと、他の仕事ができないっす。……………
openssl s_client -msg -connect github.com:443
に対して、
が返ってこないから、多分、アクセスする側、つまり、自宅サーバの問題でしょう。
ええぃ、やめた、やめたぁ

……………
ちなみに…やめてねーじゃん

openssl s_client -msg -CAfile /opt/local/share/curl/curl-ca-bundle.crt -connect encrypted.google.com:443
openssl s_client -msg -CAfile /opt/local/share/curl/curl-ca-bundle.crt -connect github.com:443
と、CAファイルを指定してやると、
Verify return code: 20 (unable to get local issuer certificate)
というエラーは出なくなる。
Author: Kumecchi

コメントを残す