Amit Thaper
Amit Thaper

Reputation: 11

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. how can i remove this exception.

Upvotes: 0

Views: 1519

Answers (2)

Adrian Spinei
Adrian Spinei

Reputation: 550

It's probably the typical error with certificate being signed for another domain. See question Https Connection Android

Upvotes: 1

DonSteep
DonSteep

Reputation: 1075

One cause can be the clock on your device. If the time is years off, SSL certificates will be invalid. So if that's the case, fix is as easy as setting your device to the correct date.

Upvotes: 0

Related Questions