I'm using a health-check script in Jenkins that runs on Windows PowerShell 5.1. The script tries to access an HTTPS endpoint like this: `$response = Invoke-WebRequest -Uri "https://${IP_Name}:2443/ngat-service/admin/health" -UseBasicParsing -TimeoutSec 600`. It works perfectly fine with our Java 8 + Tomcat 8 application, but with our new Java 17 + Tomcat 10 setup, I keep hitting a timeout error: `Invoke-WebRequest : The operation has timed out.` I've confirmed that the endpoint is reachable using `Test-NetConnection`, and even `curl` can access it, although it takes about 7 minutes to get the full HTML back. My script is set to force TLS 1.2 and to ignore certificate validation. Has anyone faced a similar issue? Any tips on resolving this would be greatly appreciated!
3 Answers
Are you checking if Java is properly bound to the necessary ports? You mentioned that port 2443 is reachable according to your `Test-NetConnection`, which is great. Just be careful with the `httpRuntime executionTimeout` you found in the web.config. That setting can definitely lead to timeouts if they don't match your needs.
A 7-minute response time definitely sounds like something's off with the app. It might be worth digging into the Java 17/Tomcat 10 configuration to see if there's a performance hitch causing the delay. If everything else is passing, this could be where the issue lies.
Have you thought about running your script in PowerShell 7? I had a similar problem recently, and updating to PS7 and tweaking some syntax surprisingly resolved my issue. It might be a quick fix!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically