Skip to content

Commit fe4e74f

Browse files
committed
Localhost ssl fix.
1 parent 02471f5 commit fe4e74f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/com/nitinsurana/bitcoinlitecoin/rpcconnector/CryptoCurrencyRPC.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.apache.http.client.methods.CloseableHttpResponse;
1919
import org.apache.http.client.methods.HttpPost;
2020
import org.apache.http.client.protocol.HttpClientContext;
21+
import org.apache.http.conn.ssl.NoopHostnameVerifier;
2122
import org.apache.http.entity.ByteArrayEntity;
2223
import org.apache.http.impl.auth.BasicScheme;
2324
import org.apache.http.impl.client.BasicAuthCache;
@@ -49,7 +50,7 @@ public class CryptoCurrencyRPC {
4950
public CryptoCurrencyRPC(final String rpcUser, final String rpcPassword, String rpcHost, String rpcPort) {
5051
this.uri = "/";
5152

52-
httpClient = HttpClients.createDefault();
53+
httpClient = HttpClients.custom().setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE).build();
5354
targetHost = new HttpHost(rpcHost, Integer.parseInt(rpcPort), "https");
5455
CredentialsProvider credsProvider = new BasicCredentialsProvider();
5556
credsProvider.setCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()),

0 commit comments

Comments
 (0)