[英]Error of ssl certificate not trusted in Android
my code is this to post data to server 我的代码是将数据发布到服务器的代码
MakeValue = (String) s2.getSelectedItem();
MakeValue = MakeValue.replace(" ", "%20");
DefaultHttpClient hc=new DefaultHttpClient();
ResponseHandler res=new BasicResponseHandler();
HttpPost postMethod=new HttpPost(AppUrl.AppUrl+"dealer_service.php?action=saveCreateNewInventory");
List nameValuePairs = new ArrayList(2);
nameValuePairs.add(new BasicNameValuePair("POSTDATA", Login.GetUserID +"~"+ VinNumber.getText()
. 。 . 。 . 。
postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));
response=hc.execute(postMethod,res);
but after executing this i have an exception of ssl not trusted so please help me to solve my probs please help i spent too many days in this. 但执行此操作后,我有一个不受信任的ssl异常,因此请帮助我解决我的问题,请帮助我在此花费太多时间。 how can i remove this exception. 我如何删除此异常。
It's probably the typical error with certificate being signed for another domain. 这可能是为另一个域签名证书的典型错误。 See question Https Connection Android 查看问题Https连接Android
One cause can be the clock on your device. 原因之一可能是设备上的时钟。 If the time is years off, SSL certificates will be invalid. 如果时间已过,则SSL证书将无效。 So if that's the case, fix is as easy as setting your device to the correct date. 因此,在这种情况下,修复就像将设备设置为正确的日期一样容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.