Здесь свойства системы используются всеми приложениями в этой среде. Итак, изменение системного свойства приводит ко многим проблемам. Итак, я хочу знать,
- Есть ли способ сделать это без использования Свойства системы?
- Есть ли способ настроить все возможные https.протоколы, чтобы они
поддерживали любое соединение http или https, установленное к сторонним
системам, которые поддерживаются различные протоколы?

Код:
Код: Выделить всё
String responseStr = null;
System.setProperty("https.protocols",http-protocol); // This is set by the client applications. Previously, there was one by one (eg : "SSLv3". Then I changed it to "TLSv1.2,TLSv1.1,TLSv1,SSLv3" assuming it will enable all)
byteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(requestStr.getBytes());
URL mUrl = new URL(proxy_url);
HttpURLConnection con = (HttpURLConnection) mUrl.openConnection(); // It works fine for the HttpURLConnection when there's no (s)
con.setRequestMethod("POST");
con.setDoOutput(true);
con.setUseCaches(false);
con.setDoInput(true);
con.setRequestProperty("user-agent","Mozilla(MSIE)");
con.setRequestProperty("Accept-Encoding","gzip,deflate");
byteArrayOutputStream.writeTo(con.getOutputStream());
String encodingHeader = con.getHeaderField("Content-Encoding");
InputStream inputStream = null;
if(encodingHeader != null && encodingHeader.toLowerCase().indexOf("gzip") != -1){
inputStream = new GZIPInputStream(con.getInputStream());
}else {
inputStream = con.getInputStream();
}
if (inputStream != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int length = 0;
while ((length = inputStream.read(buffer)) != -1) {
baos.write(buffer, 0, length);
}
responseStr = new String(baos.toByteArray());
baos.close();
}
Подробнее здесь: https://stackoverflow.com/questions/342 ... onnections