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

Add functionality to skip TLS verify for mocking HCP in consul #190

Merged
merged 5 commits into from
May 24, 2023

Conversation

chapmanc
Copy link
Contributor

@chapmanc chapmanc commented May 19, 2023

🛠️ Description

When attempting to mock out the HCP api for integration testing for consul the hcp sdk calls out to a specified auth url that has tls enabled. To mock out the HCP bootstrapping and auth token call ( here and here ) we are mocking out HCP fully but are hitting issues with the hcp sdk still verifying the oauth endpoint.

Post "[https://fake-server:443/oauth2/token](https://fake-server/oauth2/token)": tls: failed to verify certificate: x509: certificate signed by unknown authority

Without this setting we verify the tls settings on the connection to the "authUrl". This allows us to mock the api without concerning the mock with actually having a valid certificate.

This follows the precedence of HCP_API_TLS and HCP_SCADA_TLS settings used for testing. None of these settings are used in a production workload.

🔗 External Links

👍 Definition of Done

  • [n/a] SDK added
  • [n/a] SDK updated
  • Tests added?
  • [n/a] Docs updated?

Copy link
Contributor

@Achooo Achooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 💯

Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in favor for the proposed changed, +1 for following the existing pattern.

@chapmanc chapmanc merged commit edd7f15 into main May 24, 2023
@chapmanc chapmanc deleted the chappie/consul/mock branch May 24, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants