Iam having this strange issue in which the retrofit keeps throwing me
\"SSL handshake aborted: ssl=0x618d9c18: I/O error during system call, Connec
I think my solution might help someone.
In my project, I had a need to do a JSON request over SSL on an older Android (4.4) and I kept getting the issue as mentioned at the top of the thread.
To fix it all I had to do was to add the class Tls12SocketFactory exactly as above.
However, I added a modified code to my project class
I added this to my oncreate
upgradeSecurityProvider();
and modified the function for context as below, and that is all. No more issues of SSL connection
private void upgradeSecurityProvider() {
try{
ProviderInstaller.installIfNeededAsync(this, new ProviderInstaller.ProviderInstallListener() {
@Override
public void onProviderInstalled() {
Log.e("SSLFix", "New security provider installed.");
}
@Override
public void onProviderInstallFailed(int errorCode, Intent recoveryIntent) {
// GooglePlayServicesUtil.showErrorNotification(errorCode, BuyersApp.this);
Log.e("SSLFix", "New security provider install failed.");
}
});
}catch (Exception ex){
Log.e("SSLFix", "Unknown issue trying to install a new security provider", ex);
}
}
That is all and no more issues.