Java app cannot connect to target server, but Browser can

2

0

I have this weird connection error where my Java app is working from some PCs, but not from others. What does not work is sucessfully establishing a HTTP connection to a certain server. Java is getting a TimeoutException.

The weird part is, on the systems where it does not work, when I open the connection in a local browser (firefox and IE), it works. I get a response not only from the authentication proxy, but with correct credentials from my server. It's HTTP 400 (Bad Request) because the browser does not send the expected JSON.

The local system is windows server 2016. The windows firewall is shut down. As far as I know, the local installation is years old. No configuration management here.

The Java app is running as a service as "NT-Authority/SYSTEM". When I run it as a local user (like the browser) it behaves the same. I could not see a difference.

When I check the TCP connection in TcpView, the status is shown as "ESTABLISHED". Does this mean the handshake succeeded?

I'm really really out of ideas. For every part of the whole system, I can argue that there cannot be an error there, because it works from most systems. Except some.

  • It cannot be the Java app, because the same code works in almost all cases.
  • It cannot be a server configuration issue, because, again, almost no clients are affected.
  • It cannot be something with authentification, because the very same credentials work as soon as I run the Java app with the exact same configuration from another local system in the same local network. The authentification configuration is the only configuration of my Java app.
  • For the same reason, it cannot be a local network configuration issue, like a proxy or something.

I also suspected other applications or viruses running on the same system, but what could they possibly do, to show this behaviour?

Any help is appreciated.

sinned

Posted 2018-11-28T10:58:38.963

Reputation: 419

Have you checked the default gateway for each computer? I found that if my machine isn't setup for a specific gateway and/or DNS I cannot connect to the server. Have you tried using the IP and not a domain name? Hope these questions help. – Osmund Francis – 2018-12-05T04:02:30.570

I had the same problem with Windows 7 and java 1.8. Did you find solution? – Dima G. – 2019-12-11T19:40:40.040

No answers