Why is my PowerShell Invoke-WebRequest timing out with Java 17/Tomcat 10?

0
0
Asked By CuriousCoder42 On

I've got a health-check script running in Jenkins using PowerShell (Windows PowerShell 5.1) that calls an HTTPS endpoint. The command looks like this: `$response = Invoke-WebRequest -Uri "https://[0m${IP_Name}:2443/ngat-service/admin/health" -UseBasicParsing -TimeoutSec 600`. This works perfectly with our older Java 8 + Tomcat 8 app, but when I switch to our newer Java 17 + Tomcat 10 app, it consistently fails with a timeout error. I know the endpoint is reachable since `Test-NetConnection` passes. Also, when I use `curl`, it takes about 7 minutes to get the full HTML, which is concerning. I've already ensured that TLS1.2 is enforced and that cert validation is ignored. Has anyone encountered this issue and found a solution?

2 Answers

Answered By TechWhiz88 On

Having to wait 7 minutes to fetch a page definitely points to an issue on the app side, rather than your PowerShell script. I would check the performance of your Java application, especially around the endpoint you're hitting. It might be worth seeing if there's any logging to get more insight into what's causing that delay.

Answered By DevExplorer12 On

Is Java using any specific ports? Since you mentioned that you're reaching port 2443 fine with `Test-NetConnection`, it's good to know. Also, if there's a `httpRuntime executionTimeout="180"` setting in the web.config file, that could potentially lead to a timeout situation. Double-check if that's affecting your setup.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.