Terraform自定义信任库

时间:2019-02-20 17:32:02

标签: terraform

尝试使用Terraform时出现以下问题。

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

所以我设置了HTTPS_PROXY env变量。

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

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

有没有一种方法可以配置terraform以在(在Windows下)使用自定义CA Root Trustore?

以下是我得到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

1 个答案:

答案 0 :(得分:0)

最后,信任库不是有原因的。

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

现在,它可以与Windows Trust中的自定义根证书一起使用,甚至可以与NTLM身份验证一起使用。