【问题标题】:Terraform custom truststoreTerraform 自定义信任库
【发布时间】:2019-07-14 11:43:22
【问题描述】:

我在尝试使用 terraform 时遇到以下问题。

我尝试通过企业代理使用 terraform。

所以我设置了 HTTPS_PROXY 环境变量。

但企业代理充当“中间人”(解析网页是否有病毒......),并配置有我们企业自己的权威机构颁发的安全服务器证书。

似乎 terraform 无法连接到 (https) 注册表,因为此 CA 根证书不受信任。

有没有办法可以配置 terraform 以使用自定义 CA Root trustore(在 Windows 下)?

下面是我得到 Terraform 尝试连接的错误(在初始化阶段)

<!-- language: none -->

> terraform.exe init

Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...

Error installing provider "aws": Get https://releases.hashicorp.com/terraform-provider-aws/: net/http: TLS handshake timeout.

Terraform analyses the configuration and state and automatically downloads
plugins for the providers used. However, when attempting to download this
plugin an unexpected error occured.

This may be caused if for some reason Terraform is unable to reach the
plugin repository. The repository may be unreachable if access is blocked
by a firewall.

If automatic installation is not possible or desirable in your environment,
you may alternatively manually install plugins by downloading a suitable
distribution package and placing the plugin's executable file in the
following directory:
    terraform.d/plugins/windows_amd64

【问题讨论】:

  • 为什么您的代理的 CA 证书尚未在您的操作系统信任库中?
  • 我的 CA 证书在 IE/Chrome 信任库中。但是 Terraform 似乎没有使用它。使用一些工具,您可以通过选项设置 cacert 或自定义信任库。例如,使用 Curl,您可以通过以下环境变量进行设置:set CURL_CA_BUNDLE=C:\tools\ROOT_CA.crt

标签: terraform


【解决方案1】:

最后,信任库不是原因。

问题是由于将 HTTPS_PROXY 环境设置为 httpS url 而不是 http。

现在它可以在 Windows 信任中使用我的自定义根证书,甚至可以使用 NTLM 身份验证。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-24
    • 1970-01-01
    • 2010-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-09
    相关资源
    最近更新 更多