The following error occurs: javax.net.ssl.SSLHandshakeException: SSL handshake aborted: ssl=0xbe6af938: I/O error during system call, Connection reset by peer
Retrofit class:
public class RetrofitClientInstance {
private static Retrofit retrofit;
public static Retrofit getRetrofitInstance() {
if (retrofit == null) {
Gson gson = new GsonBuilder().setLenient().create();
retrofit = new retrofit2.Retrofit.Builder()
.client(HelperOkHttpClient.getOkHttpClient())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
}
return retrofit;
}
}
The error / exception appears in this method:
private void makeRequestToSecondAuthStep(ArrayList<String> creds) {
AuthCheckHTTP defectSpecific = RetrofitClientInstance.getRetrofitInstance().create(AuthCheckHTTP.class);
Observable<ResponseSingleRequestAuth<Object>> observableDefectsRelated = defectSpecific.getAuthCheck();
observableDefectsRelated
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnNext(specficDefects -> {
Log.w("ASYNCLI", "In defectspecif");
if (HelperIsNull.isNull(creds.get(3))) {
creds.set(3, creds.get(5));
}
DataBaseHelper.deleteAllData();
PublisherNotificationSync.getInstance().setLastSyncDate(INITIAL_DATE);
writeCredentialsToLocalDb();
actMain.runOnUiThread(new Runnable() {
@Override
public void run() {
presenterAuthAct.downloadData();
}
}
);
})
.doOnError(
throwable -> {
HelperToastMaker.createMessage(App.getAppContext(), "У вашего пользователя нет прав на пользования мобильным приложением");
((Button) mainAct.findViewById(R.id.button)).setEnabled(true);
AppProperties.setpIdentificator("");
}
).doOnComplete(() -> {
Log.w("Event", "Fired i guess");
}).subscribe(new Observer<ResponseSingleRequestAuth<Object>>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(ResponseSingleRequestAuth<Object> objectResponseSingleRequestAuth) {
}
@Override
public void onError(Throwable e) {
// do nothing
}
@Override
public void onComplete() {
}
});
}
}
Maybe somehow you can add standards (SSL) to this Retrofit class, could anyone have encountered this or a similar problem before?
What could be the problem? A few months ago - everything worked, the project was not touched (archived) Thank you in advance
UPD: nothing to do with the certificate, this is SAP, they update themselves