Closed iandunn closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still a problem.
Multiple environments (qa/stage/production etc) share a same domain name will met this problem. @iandunn I found a workaround, here it is:
Send request with ip address instead of domain name, put domain name into Host
header.
Thanks @Shawyeok. I tried that, but I still get SSL errors. It looks like you're using http
rather than https
in your screenshots.
Maybe your server is setup to accept both? Mine redirects http
to https
.
Maybe your server is setup to accept both? Mine redirects http to https.
Yes, we still use http
protocol for most internal apis.
but I still get SSL errors.
You can disable Validate certificates
in preferences if that's ok for you.
Now Validate certificates
setting is effect for entire application, maybe add it in per request settings is more convenient.
I need to use HTTPS locally to test code that relies on SSL.
I can't disable cert validation because that would be a significant security problem. Even disabling it for a single site would be a problem in situations where production and local environments share the same hostname.
Problem
1529 describes how libcurl reuses connections for
60
seconds by default. Because of that, switching between local and production hosts is inconvenient, if they share the same hostname.Setting a
Connection: close
header doesn't seem to help.It seems like the way to modify that cache is with the
CURLOPT_DNS_CACHE_TIMEOUT
option. There doesn't seem to be a way to modify that in Insomnia, so I just have to wait 60 seconds each time I switch environments.Ideal solution
What about introducing an environment variable that would pass the value along to
CURLOPT_DNS_CACHE_TIMEOUT
? That would let people set it to0
if they want to disable the cache, or120
if they want to extend it, etc.Setting it per-environment would be good, since some environments can share hostnames while others don't.
Alternate solution
Allow plugins to set
CURLOPT_DNS_CACHE_TIMEOUT
.cc @AdityaHarindar, @Shawyeok