PR fixes a bug where if a client responds with a http URL for nextUri while using https for the overall client, you would hit some error on the request. This was due to the fact that:
We were using the https adapter for making the http call (not allowed)
If we did redirect, then we'd be using a https.Agent configured with http details, which would cause SSL cert issues as the port used would be for http instead of https.
The fix here was that:
Set the adapter to use based on what we detect from the opts object, instead of the overall client.adapter setting
Use separate agents for http vs https, which follow-redirects nicely provides a mechanism to accomplish.
This PR (along with #82) should render the change in #41 unneeded as nextUri should be properly followed regardless of http/https on its response, and that I would argue that the port for the nextUri request (if not in the response) should match the protocol of the URI, and not the overall client one.
The certs used for nginx were generated using the command:
PR fixes a bug where if a client responds with a
http
URL fornextUri
while usinghttps
for the overall client, you would hit some error on the request. This was due to the fact that:https
adapter for making the http call (not allowed)https.Agent
configured withhttp
details, which would cause SSL cert issues as the port used would be forhttp
instead ofhttps
.The fix here was that:
opts
object, instead of the overallclient.adapter
settingfollow-redirects
nicely provides a mechanism to accomplish.This PR (along with #82) should render the change in #41 unneeded as
nextUri
should be properly followed regardless of http/https on its response, and that I would argue that the port for thenextUri
request (if not in the response) should match the protocol of the URI, and not the overall client one.The certs used for nginx were generated using the command:
where the certs would need to be refreshed in 1000 years.