OpenNebula / terraform-provider-opennebula

Terraform provider for OpenNebula
https://www.terraform.io/docs/providers/opennebula/
Mozilla Public License 2.0
61 stars 54 forks source link

Flow client ignores `insecure` attribute #482

Closed benjamb closed 11 months ago

benjamb commented 11 months ago

Description

Despite the insecure attribute being set in the provider configuration, TLS verification on the flow endpoint still occurs, causing terraform to error with the following message:

│ Post "https://.../RPC2/service_template": x509: certificate has expired or is not yet
│ valid: current time 2023-08-15T16:47:53+01:00 is after 1970-01-01T00:00:00Z

Terraform and Provider version

Terraform v1.4.6
on linux_amd64
+ provider registry.terraform.io/opennebula/opennebula v1.3.0

Affected resources and data sources

N/A

Terraform configuration

provider "opennebula" {
  endpoint      = "https://..."
  flow_endpoint = "https://..."
  username      = "user"
  password      = "pass"
  insecure      = true
}

terraform {
  required_providers {
    opennebula = {
      source  = "OpenNebula/opennebula"
      version = "~> 1.3"
    }
  }
}

Expected behavior

terraform authenticates with the insecure endpoint without error.

Actual behavior

terraform errors when authenticating with the insecure endpoint.

Steps to Reproduce

Use a self-signed cert and attempt to deploy a service template with insecure set to true.

Debug output

No response

Panic output

No response

Important factoids

No response

References

No response

frousselet commented 11 months ago

Merged, thanks for the contribution @benjamb

benjamb commented 11 months ago

@frousselet Of course! Thanks for the review!