1 Answer
- Newest
- Most votes
- Most comments
0
There was no issue with the client's proxy. This turned out to be a conflict with the default proxy settings used by Hoverfly.
The solution was to set the proxyLocalHost flag in the Hoverfly configuration to true. That's because the client's builder logic in the AWS CRT HTTP Client was reading Hoverfly's default values for the environment variable "http.nonProxyHosts" and then setting the client's proxy configuration to null with its builder logic. The workaround was to modify the Hoverfly configuration to set the proxyLocalHost flag to true like the following:
@HoverflyCore(config = @HoverflyConfig(proxyLocalHost = true)) @ExtendWith(HoverflyExtension.class) class MyTest { // ...
This sets the proxyLocalHost environment variable to "", and it allows for the default AWS CRT HTTP Client to proxy to localhost.
Relevant content
- asked 2 years ago

This seems to work if I create a little Java sandbox, but I'm investigating why this doesn't work when I use Hoverfly in my unit tests. I have created question on stack overflow relating to the same here: https://stackoverflow.com/questions/78903310/how-to-use-the-aws-crt-http-client-with-hoverfly