web-dev-qa-db-ja.com

迷惑CA証明書の構成

企業のプロキシサーバーと自己署名CA証明書の背後でVagrantコマンドを実行すると問題が発生します。環境変数HTTP_PROXY、HTTPS_PROXY、およびHTTP_NO_PROXY変数を構成しました。

すべての企業証明書を含むJavaキーストアがあります。keytoolコマンドの-exportcertオプションを多数のオプションとともに使用しました。opensslコマンドを多数のオプションとともに使用し、結果のファイルは、Vagrantインストール内の埋め込みRubyディレクトリ内の複数の場所にあり、成功しませんでした。

Rubyとcurlの構成に関する情報を含む多くのサイトを読みましたが、Vagrantコマンドを機能させることに成功していません。私が見つけたすべての投稿はRubyと、Vagrantの埋め込みコンポーネントとしてRubyを含む)をVagrantで利用する方法がわからないcurlオプション。

Javaキーストアから証明書を正しくエクスポートし、オプションでそれらを変換して、生成されたファイルを配置して、Vagrantが企業のプロキシ経由でインターネットに正常に通信できるようにする方法を説明します。

Windows 7のVagrant 1.9.5

VagrantインストールディレクトリC:\ Apps\Vagrant \

C:\WorkArea> vagrant plugin install vagrant.proxyconf

ERROR:  SSL verification error at depth 3: self signed certificate in certificate chain (19)
ERROR:  Root certificate is not trusted (/C=US/O=xxx xxx/OU=xxx xxx Certification Authority/CN=xxx xxx Root Certification Authority 01 G2)  
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

C:\WorkArea> vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'puppetlabs/ubuntu-16.04-64-puppet' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'puppetlabs/ubuntu-16.04-64-puppet' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/puppetlabs/ubuntu-16.04-64-puppet"]
Error: SSL certificate problem: self signed certificate in certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
16
TeamDitto

問題を解決するために実行した手順を説明していませんが、ルート証明書を 正しい場所 に配置していないようです。

Vagrantをインストールしたディレクトリに移動し、embedded\cacert.pemファイルを見つけて、企業証明書の内容をファイルに追加します。保存して、操作を再試行してください。ルートCA証明書を適切にエクスポートした場合、それらはVagrantによって読み取られ、接続を許可する必要があります。

それでもファイルを結合しても機能しない場合は、環境でvagrantSSL_CERT_FILE=/path/to/your/certs.pemで実行してみてください。これにより、企業証明書を適切にエクスポートしたことを検証できます。

9
anothermh