Мое приложение java 1.7 использует быструю интеграцию книг через OAuth версии 1. Недавно QuickBooks обновил версию TLS до 1.2, так как я искал по интернету, он говорит, что мы должны явно указать версию TLS для интеграции java 1.7 с QuickBooks.Может кто-нибудь помочь мне указать версию TLS явно для приведенных ниже кодов.
String output = "";
InputStream inputStraem = null;
DefaultHttpClient client = new DefaultHttpClient();
client.getParams().setParameter("http.protocol.content-charset", "UTF-8");
HttpRequestBase httpRequest = null;
URI uri = null;
try {
uri = new URI(customURIString);
} catch (URISyntaxException e) {
_logger.error("URISyntaxException :: "+e.getMessage());
}
String methodtype = "GET";
if (methodtype.equals(MethodType.GET.toString())) {
httpRequest = new HttpGet(uri);
}
httpRequest.addHeader("content-type", "application/xml");
httpRequest.addHeader("Accept","application/xml");
oAuthConsumer.sign(httpRequest);
HttpResponse httpResponse = null;
HttpHost target = new HttpHost(uri.getHost(), -1, uri.getScheme());
httpResponse = client.execute(target, httpRequest);
inputStraem = httpResponse.getEntity().getContent();
StringWriter writer = new StringWriter();
IOUtils.copy(inputStraem, writer, "UTF-8");
output = writer.toString();