0

I am trying to get a web page's source code with java 1.8.0_221. (support TLSv1.0, TLSv1.1, TLSv1.2) I tried Jsoup, URLConnection, HttpURLConnection, none of them works, same error. Could anyone give me some suggestions, thank you!

html = Jsoup.connect("https://news.google.com/rss/search?q=vehicle").get().html();

error: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

html = Jsoup.connect("https://spectrum.ieee.org/rss/energy/fulltext").get().html();

error: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

Koushik Roy
  • 6,868
  • 2
  • 12
  • 33
Joe boo
  • 31
  • 2
  • 3

1 Answers1

0

In my browser,

https://news.google.com/rss/search?q=vehicle

redirects to

https://news.google.com/rss/search?q=vehicle&hl=en-US&gl=US&ceid=US:en

Maybe you need to specify a browser user agent in your code.

Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111
  • still get this error: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake – Joe boo Oct 28 '20 at 14:24