Skip to content

proxy_url value of https://localhost:<port> throws Unable to connect to the server: proxyconnect tcp: tls: first record does not look like a TLS handshake #1653

@romoy

Description

@romoy

The following configuration throws a connect error.

provider "kubernetes" {
host = "value"
token = "value"
cluster_ca_certificate = base64decode(value)
client_certificate = base64decode(value)
client_key = base64decode(value)
proxy_url = "https://127.0.0.1:8888"
}

Unable to connect to the server: proxyconnect tcp: tls: first record does not look like a TLS handshake

I can reproduce the same connect error with command
HTTPS_PROXY=https://127.0.0.1:8888 kubectl

I can access kubernetes using
HTTPS_PROXY=127.0.0.1:8888 kubectl

Terraform Version, Provider Version and Kubernetes Version

Terraform version: v1
Kubernetes provider version: v2.8.0
Kubernetes version: v1.22.5

Affected Resource(s)

Unable to connect to Kubernetes api through https proxy

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

Debug Output

Panic Output

Steps to Reproduce

  1. terraform apply

Expected Behavior

What should have happened?

  1. Successful connection to kubernetes api to resolve kubernetes_manifest

Actual Behavior

What actually happened?

  1. Failure to connect with the following message "Unable to connect to the server: proxyconnect tcp: tls: first record does not look like a TLS handshake"

Important Factoids

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions