Hostname does not match in Lollipop devices but works fine in Postman and marshmallow devices
问题 Recently SSL certificates were added to the server, so I have changed the url in android from http://appname.com to https://www.appname.com , this works fine on marshmallow devices and Postman, but on Lollipop devices throws javax.net.ssl.SSLException: hostname in certificate didn't match: www.appname.com != www.companyname.com OR www.companyname.com OR companyname.com I have tried adding the companyname.com in setHostnameVerifier but it did not help. here is the code: HashMap<String, String>