1

Делаю приложение для общения с сервером по htpps, на сервере имеется сертификат. Как мне настроить защищенное соединение проверив сертификат сервера в данном классе?

public class CustomTrustManager implements X509TrustManager {

@Override
public void checkClientTrusted(X509Certificate[] chain, String authType)
        throws CertificateException {}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType)
        throws CertificateException {}
@Override
public X509Certificate[] getAcceptedIssuers()
{
    return null;
}

}

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Посмотрите другие вопросы с метками или задайте свой вопрос.