简体   繁体   English

Android不信任的SSL证书错误

[英]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.

相关问题 Android SSL错误:证书不受信任 - Android SSL error: certificate not trusted Android SSL错误:证书不受信任......有时候 - Android SSL error: certificate not trusted…sometimes Android SSL错误:证书不受信任......有时候 - Android SSL error: certificate not trusted…sometimes 使用自定义TrustManager的Android中的SSL网站不信任证书 - Certificate not trusted of SSL website in Android with custom TrustManager 错误:Android 2.3及更早版本上的不受信任的服务器证书 - Error: Not trusted server certificate on Android 2.3 and older Android Https错误不可信服务器证书 - Android Https error Not trusted server certificate 获取javax.net.ssl.SSLException:Android中不受信任的服务器证书 - Getting javax.net.ssl.SSLException: Not trusted server certificate in Android Android中的“javax.net.ssl.SSLException:不受信任的服务器证书”异常 - “javax.net.ssl.SSLException: Not trusted server certificate” exception in Android 证书受PC信任,但不受Android信任 - Certificate is trusted by PC but not by Android Android 2.2:javax.net.ssl.SSLException:不受信任的服务器证书 - Android 2.3:javax.net.ssl.SSLPeerUnverifiedException:没有对等证书 - Android 2.2: javax.net.ssl.SSLException: Not trusted server certificate - Android 2.3: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM