I have an API that runs fine on one of my two web servers but not on the other one or on my local machine, instead I get a connection failure when I send https requests as p
There are a number of scenarios here that could present this message.
There are also a number of detailed blog posts and threads that could help you through investigating your issue.
1) DNS resolution issue -- ensure you can hit the endpoint url, or this error will be produced.
2) Ensure to set a user agent in the cfhttp request, servers easily can detect non-standard user agents and filter them out.
enter code here
3) Disable compression in the request. In cases where you are hitting some servers, this works. This can come up with some configurations of IIS. There are numerous sites with this example on the search and it has worked for me.
Another header you can try to send depending on the http server on the other end is:
Source
4) If the issue is caused by an SSL certificate, you can manually add the certificates to your server. I prefer not to look in this direction if possible but you can search for it.
5) Another scenario of connecting to an https url is that there may be a need to disable the default certificate provider (there are many in Java and the default one may not fit what is needed). This does not impact security, only uses a different, equivalent library.
Source for Example 5
6) Last but not least, you may be falling prey to rewrite rules. I have not experienced this, but it looks interesting.
CFHTTP "Connection Failures" issues when using mod_rewrite