How to use HttpsURLConnection through proxy by setProperty?

前端 未结 3 1493
梦如初夏
梦如初夏 2020-12-10 03:29

Network environment:

Https Client<=============>Proxy Server<==============>Https Server
       

3条回答
  •  旧时难觅i
    2020-12-10 03:36

    Your URL connection is https whereas you are only setting the http proxy.

    Try setting the https proxy.

    //System.setProperty("https.proxySet", "true"); 
     System.setProperty("https.proxyHost",10.100.21.11);
     System.setProperty("https.proxyPort","443");
    

    EDIT @EJP is correct. There is no https.proxySet .. I copied your original question and included in the answer.

提交回复
热议问题