-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 remote for tfstate: x509: certificate signed by unknown authority #10410
Comments
This just means that Terraform can't verify the TLS cert. Terraform uses the Go standard library to check this which further uses your system CA certificates. Terraform doesn't ever touch CA certificate lookup (just uses default). If this works on colleague machines then it sounds like something may not be right with your CA certs. |
I have a question related to this one.. I am not a go user, and my google-fu has not helped me find this answer.. Is there some environment variable that I can set to point terraform (or packer.etc) at a different cacert file? |
@Cinderhaze, not sure your question is in scope of this issue. In my case OS keychain with globally-accepted CA certs failed. For S3 those CA are "DigiCert Baltimore CA-2 G2" (and "Baltimore CyberTrust Root" as a parent). Normally, trust to that king of CAs is distributed by OS vendors with OS security updates. func certKeychains() []string {
keychains := []string{
"/System/Library/Keychains/SystemRootCertificates.keychain",
"/Library/Keychains/System.keychain",
}
home, err := homedir.Dir()
if err == nil {
loginKeychain := path.Join(home, "Library", "Keychains", "login.keychain")
keychains = append(keychains, loginKeychain)
}
return keychains
} Although, I've manually downloaded "DigiCert Baltimore CA-2 G2" and "Baltimore CyberTrust Root", added them to System keychain, configured them to be always trusted, - it didn't help. (but that was just an experiment - it shouldn't be solved in such a manner) Probably our IT support dept or security dept confused something, when hardened my work Mac. As a temporary solution I made a Vagrant script that provisions Ubuntu with all DEV tools required - Terraform works well there... |
@andrejs-sisojevs-accenture @mitchellh For now I am downgrading to 0.7.7 until this is fixed. |
@takieddine-sbiai This came up yesterday, I believe the cert security issue fixed in Go 1.7.4 is causing some issues for people. Please see the Go 1.7.4 changelog, I don't believe this is a bug on our end or Go, but a system configuration issue, though not 100% sure. We haven't touched any of the HTTP client code, etc. |
Hitting this problem with terraform 0.8.1 from homebrew (https://github.com/onlydole/homebrew-core/blob/master/Formula/terraform.rb) which uses go 1.7.4.. Also potentially related: golang/go#18141 and #10718 |
Using the 0.8.3 binary from https://www.terraform.io/downloads.html instead of homebrew installed version seemed to have resolved the issue. |
I had it previously installed from hashicorp binaries - didn't work. Tried with 0.8.3 binaries - same failure. |
Hey in my case terraform works on ec2 host but inside container using official terraform docker container and mounting the hosts directory (for certs) to the container and when i do terraform init form inside the container I get the following error, which works fine from the host any fix for this, please let me know. Error configuring the backend "s3": RequestError: send request failed Please update the configuration in your Terraform files to fix this error |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hello
I'm getting a very strange error, when configuring S3 remote for tfstate. My colleagues are using same commands, and don't get this error - everything works fine for them. So I guess that might be related to Terraform dependencies or OS. Any ideas where I should search for failure reason?
Terraform versions 0.7.7-0.7.13.
Although .tfstate in S3 bucket if fine (uploaded by colleagues who do not have problems with terraform), locally it generates almost empty file
Tried exposing bucket - did not help.
No old plugins in OS ("terraform-*" files)
Any ideas?
The text was updated successfully, but these errors were encountered: