opentofu/internal
Sheridan C Rawlins 75e5ae27a2
[fixes 31700] Add mTLS support for http backend by way of client cert & key, as well as enterprise cacert. (#31699)
* Add mTLS support for http backend by way of client cert & key, as well as enterprise cacert.

* Fix style.

* Skip cert validation to be sure error is related to missing client cert; not untrusted server cert.

* Remove misplaced err check.

* Fix the size of test using http backend.

* Just for correctness, include all certs in the pem encoded cert - sometimes certs come with a chain of their signers.

* Adjusted names as recommended in PR comments.

* Adjusted names to be full-length and more descriptive.

* Added full-fledged testing with mTLS http server

* Fix goimports.

* Fix the names of the backend config.

* Exclusive lock for write and delete.

* Revert "Fix goimports."

This reverts commit 7d40f6099fbbb675fb2e25e35ee40aeafe3d0a22.

* goimports just for server test.

* Added the go:generation for the mock.

* Move the TLS configuration out to make it more readable - don't replace the HTTPClient as the retryablehttp already creates one - just configure its TLS.

* Just switch the client/data params - felt more natural this way.

* Update internal/backend/remote-state/http/backend.go

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

* Update internal/backend/remote-state/http/testdata/gencerts.sh

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

* Update internal/backend/remote-state/http/backend.go

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

* Update internal/backend/remote-state/http/backend.go

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

* Update internal/backend/remote-state/http/backend.go

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

* Update internal/backend/remote-state/http/backend.go

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

* the location of the file name is not sensitive.

* Added error if only one of client_certificate_pem and client_private_key_pem are set.

* Remove testify from test cases; use t.Error* for assert and t.Fatal* for require.

* Fixed import consistency

* Just use default openssl.

* Since file(...) is so trivial to use, changed the client cert, key, and ca cert to be the data.

See also https://github.com/hashicorp/terraform-provider-http/pull/211

Co-authored-by: Sheridan C Rawlins <scr@ouryahoo.com>
Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>
2023-01-26 14:08:07 +00:00
..
addrs addrs: ModuleSourceRemote.String correctly handles query string in URL 2022-08-31 09:13:24 -07:00
backend [fixes 31700] Add mTLS support for http backend by way of client cert & key, as well as enterprise cacert. (#31699) 2023-01-26 14:08:07 +00:00
builtin Added Quiet value (#32116) 2023-01-25 16:51:14 +00:00
checks core: Propagate check results accurately from plan to apply 2022-08-26 15:47:29 -07:00
cloud Expand error when discovery document request fails (#32394) 2023-01-24 15:19:12 -07:00
command [fixes 31700] Add mTLS support for http backend by way of client cert & key, as well as enterprise cacert. (#31699) 2023-01-26 14:08:07 +00:00
communicator fix typo in upload size check 2022-11-11 14:25:34 -05:00
configs Fix accidental mutation of shared cty.Paths in ValueMarks funcs 2023-01-19 12:39:19 -08:00
copy test: use T.TempDir to create temporary test directory (#30803) 2022-04-08 17:34:16 +01:00
dag Clarify some comments in internal/dag 2022-10-06 15:10:33 -07:00
depsfile Ignore existing package hashes for providers lock command (#31389) 2022-07-20 13:27:24 +01:00
didyoumean didyoumean: move from "helper" to "internal" 2020-10-02 13:35:07 -07:00
e2e fix: pre allocate for composite literal 2022-11-22 02:20:54 +09:00
earlyconfig tfdiags: Expose the "extra information" concept from HCL 2022-06-23 13:52:23 -07:00
experiments build: Use Go 1.19 2022-08-22 10:59:12 -07:00
getmodules add XTerraformGetLimit to prevent redirect loops 2022-06-01 12:46:22 -04:00
getproviders build: Use Go 1.19 2022-08-22 10:59:12 -07:00
grpcwrap s/Capabilities/ServerCapabilities/ 2022-07-06 13:47:35 -04:00
helper/slowmessage remove wrapped streams and readline 2021-10-28 11:51:39 -04:00
httpclient backend/azurerm: removing ADAL support 2022-05-18 16:56:10 +02:00
initwd Use the apparentlymart/go-versions library to parse module constraints (#32377) 2022-12-14 17:02:11 +01:00
instances InstancesForModule should not panic 2021-12-17 13:31:41 -05:00
ipaddr build: Use Go 1.19 2022-08-22 10:59:12 -07:00
lang Add function descriptions (#32453) 2023-01-16 10:48:31 +00:00
legacy build: Use Go 1.19 2022-08-22 10:59:12 -07:00
logging cleanup panic output 2021-12-17 11:57:52 -05:00
modsdir Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
moduledeps Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
moduletest fixup broken test fixtures 2022-07-06 13:47:35 -04:00
plans Merge pull request #32563 from hashicorp/jbardin/optional-computed-comparison-next 2023-01-25 15:05:50 -05:00
plugin s/Capabilities/ServerCapabilities/ 2022-07-06 13:47:35 -04:00
plugin6 fix: pre allocate for composite literal 2022-11-22 02:20:54 +09:00
provider-simple s/Capabilities/ServerCapabilities/ 2022-07-06 13:47:35 -04:00
provider-simple-v6 s/Capabilities/ServerCapabilities/ 2022-07-06 13:47:35 -04:00
provider-terraform/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
providercache cliconfig: Allow forcing use of the plugin cache despite the lock file 2023-01-25 08:23:01 -08:00
providers s/Capabilities/ServerCapabilities/ 2022-07-06 13:47:35 -04:00
provisioner-local-exec/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provisioners Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
refactoring allow cross-package move statements (#31556) 2022-08-16 16:52:57 +02:00
registry revert "run goimports" 2022-08-01 16:26:26 -05:00
repl Unify all sensitive value plan output as "(sensitive value)" 2022-10-24 12:50:46 -06:00
replacefile Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
states normalize empty CheckResults fields in stateV4 2022-11-01 16:18:38 -04:00
terminal remove the use of panicwrap 2021-10-28 11:51:39 -04:00
terraform test references only from output preconditions 2023-01-05 10:01:25 -05:00
tfdiags build: Use Go 1.19 2022-08-22 10:59:12 -07:00
tfplugin5 go get cloud.google.com/go/storage@v1.28.0 (#32203) 2022-11-21 13:14:55 +00:00
tfplugin6 go get cloud.google.com/go/storage@v1.28.0 (#32203) 2022-11-21 13:14:55 +00:00