Mac OS X Sierra から High Sierra にアップグレードした後に Composer (PHP パッケージ) の調子がおかしく composer install しても
Downloading (failed)
Downloading (failed) Failed to download xxxx/xxxx from dist: The "https://api.github.com/repos/xxxx/xxxx" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
ror messages:
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Failed to enable crypto
failed to open stream: operation failed
と OpenSSL のエラーでちゃんとレポジトリからダウンロードできなかったというエラーが起こって四苦八苦していましたが、Mac OS のアップグレードをした後に、X Code のコマンドラインツールの設定がおかしくなっていたのが原因でした。
OpenSSL のパス確認方法
xcode-select -p
/Applications/Xcode.app/Contents/Developer
と表示されるとおかしいので、修正する。
sudo xcode-select -switch /Library/Developer/CommandLineTools
再度
xcode-select -p
で、/Library/Developer/CommandLineTools
であると修正完了。
参考
MacのhomebrewでOpenSSLがビルドエラーになる場合の対処方法
https://techracho.bpsinc.jp/hachi8833/2016_09_09/25454