1

From my java program I'm connecting to a website using Jsoup.connect method. All works well till I connect to VPN to go on my company network. When I connect to VPN, I am still able to access website using browser but my java program can not connect and gives either java.net.UnknownHostException or following exception.

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:675)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:516)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:493)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:205)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:194)

I can not even ping a website using command prompt. Again, there is no issue when i access using browser.

enter image description here

Stephan
  • 41,764
  • 65
  • 238
  • 329
Sachin
  • 449
  • 2
  • 9
  • 27
  • Are you using a proxy? It probably auto assigns one using [wpad](https://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol). – Ferrybig Feb 02 '16 at 10:05
  • I use a 'BIG-IP Edge Client' to connect to company network. Does that answer your question? – Sachin Feb 02 '16 at 10:31
  • A little, can you follow the following steps to check if you are using a proxy? https://superuser.com/questions/346372 The symtoms of your problem point at a auto configured proxy server, but I want to make sure that is the actual problem. – Ferrybig Feb 02 '16 at 10:35
  • I used the java program mentioned on the forum you provided to find if any proxy is being used and it sates 'No Proxy' – Sachin Feb 02 '16 at 10:58
  • please check firewall setting – Musaddique S Feb 02 '16 at 12:02
  • what exactly you want me to check when you say firewall setting? and wouldnt firewall setting block access via browser as well? – Sachin Feb 02 '16 at 13:30

0 Answers0