CFHTTP works one time per restart
- January 15, 2021
- 5 replies
- 1512 views
Hello All-
I have a strange problem with CFHTTP.
I am sending JSON to a server using HTTPS via CFHTTP. My code worked successfully under CF2016 for quite a while. I migrated servers, now using CF2018, on Windows 2019.
My problem is that now I can send ONE post successfully via cfhttp, then it will no longer work. I receive a 'Connection Failure' error after the first success. I've repeated this exercise at least 30 times, with the same result each time.
This is secure, and initially I thought the problem was with my Java certificates. I installed what I believe are the correct certs.
The strange part, is that it will work ONCE every time I restart CF. I can successfully POST the JSON, and view the results on the target server, as well as receiving the appropriate response from the server. The next POST will fail. Every attempt after that will fail- even re-running the initial post that was successful previously.
But if I restart the CF service, the next POST will be successful- then all of the others will fail.
The fact that it does work initially, leads me to believe this is not firewally, certificates, external server, etc. Everything I can figure out points to CF as the problem- as restarting it will 'fix' the problem for one more iteration.
This is my code- the same exact code worked on my previous server:
