fix: override oauth2.HTTPClient w/ ctx correctly #4006
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the various commands that exist to help you do the OAuth2 flow locally were not overriding the
oauth2.HTTPClient
via the context correctly. This meant that if you were e.g. running Hydra locally and using a self-signed/test TLS certificate, the flows would fail with TLS errors even in the presence of the--skip-tls-verify
flag.Steps to reproduce bug:
Set
SERVE_TLS_CERT_BASE64
andSERVE_TLS_KEY_BASE64
to something self-signed/PEM that will otherwise not be considered valid.Enable TLS serving in Hydra's config:
Create a test client:
Use
perform
to try and do anauthorization-code
:Observe failure, as if

--skip-tls-verify
had not been set at all:Apply diff in this PR.
It works as you'd expect:

Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
[email protected]) from the maintainers to push
the changes.
I have added or changed the documentation.Not applicable, docs already contained information about this flag; it just didn't work.Further Comments
Minor change.