Skip to content

支持Https

Tamic (码小白) edited this page Jul 18, 2017 · 7 revisions

信任所有Https

skipSSLSocketFactory(true)

支持Https

如何快速支持Https

单个addSSLSocketFactory

novate.addSSLSocketFactory(NovateHttpsFactroy.creatSSLSocketFactory(getApplicationContext(), "file.cer"));

test.cer放在assert文件夹下面。

多个 addSSL

int[] certificates = {R.raw.myssl1, R.raw.myssl2,......}
int[] hosts = {"https:// you hosturl2", "https:// you hosturl2",......}  

novate.addSSL(hosts,  certificates)

certificates是你的ssl证书文件,在raw文件下的的id数组,项目中请放到raw资源文件夹下。

Clone this wiki locally