Intuits Quickbook OAuth1-为Java 1.7显式指定TLS版本

时间:2018-10-18 19:57:31

标签: java oauth quickbooks tls1.2 intuit

我的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();

0 个答案:

没有答案