Https Connection Android

后端 未结 15 2006
萌比男神i
萌比男神i 2020-11-22 04:43

I am doing a https post and I\'m getting an exception of ssl exception Not trusted server certificate. If i do normal http it is working perfectly fine. Do I have to accept

15条回答
  •  自闭症患者
    2020-11-22 05:29

    Probably you can try something like this. This helped me

        SslContextFactory sec = new SslContextFactory();
        sec.setValidateCerts(false);
        sec.setTrustAll(true);
    
        org.eclipse.jetty.websocket.client.WebSocketClient client = new WebSocketClient(sec);
    

提交回复
热议问题