7

I have this problem with HTTPS requests on android - No peer certificate. I've mentioned that Google are flood with people's question about this problem. Sad enough that NONE of that question has answer which works for me.

But at least I want to know a cause of that error. I couldn't even find what is it - peer certificate. And when that error could appear? I have error even on normal secured sites which has valid certificate. Why is it invalid when doing request from android?

P.S. I don't want to see answers like "you should trust all certificates". No, I shouldn't. I want my application act like normal browser which works silently when certificate is valid otherwise notify user about certificate problem.

Community
  • 1
  • 1
Vitalii Korsakov
  • 45,737
  • 20
  • 72
  • 90

1 Answers1

1

The peer certificate is the certificate of the peer. In this case, the certificate of the server. If it isn't valid, it wasn't accepted during the handshake, so you can't get it in the client.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • 1
    What if it is valid? At least browser does not find any errors, but application does. – Vitalii Korsakov Jan 22 '14 at 07:23
  • @VitaliiKorsakov If it's valid you need to check whether that identify is *authorized* to use this application, or this part of it. This isn't something SSL can do for you. – user207421 May 22 '20 at 00:54