Skip to content
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

disable_certificate_validation does not work in definitions #96

Closed
filex opened this issue Jan 18, 2021 · 1 comment · Fixed by #97
Closed

disable_certificate_validation does not work in definitions #96

filex opened this issue Jan 18, 2021 · 1 comment · Fixed by #97
Labels
bug Something isn't working theme/config
Milestone

Comments

@filex
Copy link
Contributor

filex commented Jan 18, 2021

My couper.hcl:

server "my-api" {
  api {
    endpoint "/**" {
      backend  = "foo"
    }
  }
}
definitions {
  backend "foo" {
    origin = "https://self-signed.badssl.com"
    disable_certificate_validation = true
  }
}

Although disable_certificate_validation is active, I get a request error:

$ http :8080/
…
{
    "error": {
        "code": 4002,
        "id": "c02mu9h8d3b4hja4foi0",
        "message": "API upstream connection error",
        "path": "/",
        "status": 502
    }
}

Couper's backend log says:

x509: certificate signed by unknown authority

However, the settings works, when defined in the endpoint:

server "my-api" {
  api {
    endpoint "/**" {
      backend {
        origin = "https://self-signed.badssl.com"
        disable_certificate_validation = true
      }
    }
  }
}

This config yields a 200, as expected.

@malud malud added this to the 0.5 milestone Jan 18, 2021
@malud malud added bug Something isn't working theme/config labels Jan 18, 2021
@malud
Copy link
Collaborator

malud commented Jan 18, 2021

The issue here is the missing decode for hcl attributes which are not part of the related inline scheme and passing them to the desired options struct. Also the attribute test coverage must be increased along with a startup validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme/config
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants