user1071138
user1071138

Reputation: 666

"No peer certificate" android application

i'm working on an application for android devices( 2.2). I'm trying to get an html page.The java code I use seems to work, so I can obtain the page I want, but sometimes the app crashes and i get the exception: "no peer certificate". When this happens, if I wait one hour or I change network, it works normally. Does someone know how to solve this? The site is https://stud.infostud.uniroma1.it/Sest/Log/

I'm really sorry about my english, I hope you'll understand!

Upvotes: 4

Views: 11158

Answers (2)

Tyler
Tyler

Reputation: 137

When I was getting that exception it was because my phones date was not correctly set. I just switched back to using the network provided date and everything worked.

Upvotes: 7

FunkTheMonk
FunkTheMonk

Reputation: 10938

Try putting this before you make the network call:

System.setProperty("http.keepAlive", "false");

It sounds like you're having issues with a known issue that causes Android to break when trying to be clever with its connections. If that doesn't work check here

Upvotes: -1

Related Questions