LoginSignup
6
6

More than 5 years have passed since last update.

MacOS XでMercurialのSSLサーバ証明書の警告を解消する

Last updated at Posted at 2013-02-19

MercurialでリモートのサーバにHTTPSでアクセスすると以下のような警告が表示される場合がある。これは、Mercurialが参照するルート証明書の設定が行われていないのが原因である。

warning: hg.example.jp certificate with fingerprint 41:e6:46:86:a0:a2:f3:e7:8d:35:06:be:1c:88:fb:59:61:e0:e5:12 not verified (check hostfingerprints or web.cacerts config setting)

対処方法1

ダミー証明書 /etc/hg-dummy-cert.pem を作成。

openssl req -new -x509 -extensions v3_ca -keyout /dev/null -out dummycert.pem -days 3650
sudo cp dummycert.pem /etc/hg-dummy-cert.pem

Mercurialがダミー証明書を参照するよう ~/.hgrc に以下の設定を追加。

~/.hgrc
[web]
cacerts = /etc/hg-dummy-cert.pem

対処方法2

RubyとHomebrewがインストールされている環境であれば、以下の手順でも良い。

ルート証明書取得。

brew install curl-ca-bundle

取得したルート証明書を ~/.hgrc に追加。

~/.hgrc
[web]
cacerts = /usr/local/Cellar/curl-ca-bundle/1.87/share/ca-bundle.crt

参考

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6