java https networking issue

前端 未结 3 1964
孤城傲影
孤城傲影 2021-01-18 17:27

I\'m trying to implement simplest HTTPS communication program. There are a lot of examples on the web, but I fail to run them successfully.
Here is one example:

3条回答
  •  一整个雨季
    2021-01-18 18:29

    Did you write this code yourself or copy it from somewhere? I only ask because it is not the way I usually make a HTTPS connection. The first thing I'd do when testing HTTPS is find server that will respond to a HTTPS request. www.sun.com will redirect to an Oracle page and while this is still valid it is possibly not what you want.
    I can't be 100% sure on the first but I suspect you're suffering from either a blocking read or write. Debugging could help.
    The only time I have seen that stack trace was when the JCE classes for Java 5 and 6 were mixed up and the Java version couldn't cope. The same code in HttpsTest "works for me"

提交回复
热议问题