SSLSocketFactory.getSocketFactory().setHostnameVerifier(new AllowAllHostnameVerifier()); 只需要在进入程序的首页创建视图时加上这句代码就ok了.