Self-signed certificate and loopj for Android

前端 未结 6 551
太阳男子
太阳男子 2021-01-30 15:08

I\'m trying to use loopj for making async HTTP requests. Works great, except when I try to access https site with self-signed cert. I get

6条回答
  •  灰色年华
    2021-01-30 15:57

    You can use constructor AsyncHttpClient(boolean fixNoHttpResponseException, int httpPort, int httpsPort). From version loopj library 1.4.4 and bigger. For example

    mClient = new AsyncHttpClient(true, 80, 443);
    

    and you get warning message to logcat at the Verbose log.

    Beware! Using the fix is insecure, as it doesn't verify SSL certificates.
    

提交回复
热议问题