Safely fixing: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate

It turns out my code was fine and the problem was that the server was not returning the full certificate chain. For more information see this SO post and this superuser post:

SSL certificate is not trusted – on mobile only

https://superuser.com/questions/347588/how-do-ssl-chains-work

Leave a Comment