Android "HTTP FAILED: javax.net.ssl.SSLHandshakeException: Chain validation failed" exception after hostname changes

554 Views Asked by At

Who knows how to fix this problem?

This is my prod server:

debug {
   proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
   buildConfigField "String", "BASE_URL", "\"https://pethouse.ua/\""
}

But if I change hostname to test-server, like this:

debug {
   proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
   buildConfigField "String", "BASE_URL", "\"https://test.pethouse.ua/\""
}

When my app starts and make first request to server I getting exception:

--> GET https://test.pethouse.ua/app/v1/ua/...../

<-- HTTP FAILED: javax.net.ssl.SSLHandshakeException: Chain validation failed

The same request from Postman - works fine. Restarting emulator doesn't helps. Date and time on emulator are set correctly.

1

There are 1 best solutions below

0
Bijal Sutariya On

You have to check validity of your api url on SSL checker page https://www.sslshopper.com/ssl-checker.html

if it's expired then you have to update it's expiry time.