В своем приложении я пытаюсь сделать запрос на послание HTTPS на мой сервер. Я попытался отправить запрос, используя почтальон, и получил ответ от сервера. Что может вызвать эту ошибку, когда я пытаюсь отправить запрос из приложения? < /p>
Здесь фрагмент кода, где я пытаюсь отправить запрос сообщения: < /p>
public static JSONObject getDataLibConfiguration(Context context) throws HttpRequestException {
int statusCode = 0;
JSONObject commonInformation;
HttpsURLConnection connection = null;
try {
commonInformation = ConfigurationProcessor.getCommonInformation(context);
if (commonInformation == null) {
return null;
}
URL url = new URL(BuildConfig.SERVER_CONFIG_URL);
if (BuildConfig.DEBUG) {
LogUtils.d(TAG, "url = " + url.getPath());
}
connection = getHttpsConnection(url);
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
connection.setRequestProperty("Content-Encoding", "gzip");
byte[] gzipped = HttpUtils.gzip(commonInformation.toString());
cos = new CountingOutputStream(connection.getOutputStream()); //
Подробнее здесь: https://stackoverflow.com/questions/532 ... w-to-solve
Sslhandshakeexception - Проверка цепей цепочки не удалась, как решить? ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение