Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Add ability to bypass certificate authority check if, say, the https-enabled server uses a self-signed cert #12

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

schahal
Copy link
Contributor

@schahal schahal commented Aug 27, 2018

Related to the following issue: #11

Test Results

Unit tests:

$ make test
==> Checking that code complies with gofmt requirements...
go test -i $(go list ./... |grep -v 'vendor') || exit 1
echo $(go list ./... |grep -v 'vendor') | \
	xargs -t -n4 go test  -timeout=30s -parallel=4
go test -timeout=30s -parallel=4 github.com/terraform-providers/terraform-provider-influxdb github.com/terraform-providers/terraform-provider-influxdb/influxdb 
?   	github.com/terraform-providers/terraform-provider-influxdb	[no test files]
ok  	github.com/terraform-providers/terraform-provider-influxdb/influxdb	0.006s

Acceptance test:

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v  -timeout 120m
?   	github.com/terraform-providers/terraform-provider-influxdb	[no test files]
=== RUN   TestAccInfluxDBContiuousQuery
--- PASS: TestAccInfluxDBContiuousQuery (0.27s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccInfluxDBDatabase
--- PASS: TestAccInfluxDBDatabase (0.13s)
=== RUN   TestAccInfluxDBDatabaseWithRPs
--- PASS: TestAccInfluxDBDatabaseWithRPs (0.38s)
=== RUN   TestAccInfluxDBUser_admin
--- PASS: TestAccInfluxDBUser_admin (0.41s)
=== RUN   TestAccInfluxDBUser_grant
--- PASS: TestAccInfluxDBUser_grant (0.89s)
=== RUN   TestAccInfluxDBUser_revoke
--- PASS: TestAccInfluxDBUser_revoke (0.50s)
PASS
ok  	github.com/terraform-providers/terraform-provider-influxdb/influxdb	2.592s

Functional Tests

Setting and unsetting the environment variable
$  export INFLUXDB_SKIP_SSL_VERIFY=1
$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

influxdb_database.demo-test-db-creation: Refreshing state... (ID: demo_test_tf_db)

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
$  export INFLUXDB_SKIP_SSL_VERIFY=0
$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: Error refreshing state: 1 error(s) occurred:

* provider.influxdb: error pinging server: Get https:/<REDACTED>:8443/ping: x509: certificate signed by unknown authority


$  unset INFLUXDB_SKIP_SSL_VERIFY
$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


Error: Error refreshing state: 1 error(s) occurred:

* provider.influxdb: error pinging server: Get https://<REDACTED>:8443/ping: x509: certificate signed by unknown authority
Updating config to include skip_ssl_verify
provider “influxdb” {
 url      = “https://<REDACTED>:8443”
 username = “admin”
 skip_ssl_verify = true
}
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
 + create
...

@ghost ghost added the size/S label Aug 27, 2018
@schahal
Copy link
Contributor Author

schahal commented Sep 4, 2018

@radeksimko , @katbyte , @catsby : looking for a maintainer (or write-access member) of this repo to review this PR (and hopefully merge) so we can use the OSS version for an https-enabled InfluxDB with self-signed cert (rather than the patched one :) ) Thanks for your time!

@sidgod
Copy link
Contributor

sidgod commented Sep 5, 2018

@schahal Apologies for the delay, will finish reviewing this in next 2-3 days!

@sidgod
Copy link
Contributor

sidgod commented Sep 5, 2018

Change looks good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants