无法在Java

时间:2015-10-01 09:51:14

标签: java ssl

HttpClient httpClient = HttpClientBuilder.create().setSSLSocketFactory(socketFactory).build();

无法解析HttpClientBuilder。任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:4)

https://hc.apache.org/downloads.cgi下载Apache HttpClient库并将jar添加到项目中或添加maven依赖项:

<dependencies>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5</version>
    </dependency>
</dependencies>