From 7b569d2dbe8c6c04317bf821a40939671a5a7315 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 15 Feb 2015 21:34:01 +0100 Subject: [PATCH] replace depriciated HTTPClient ALLOW_ALL_HOSTNAME_VERIFIER with NoopHostnameVerifier() --- source/net/yacy/cora/protocol/http/HTTPClient.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/cora/protocol/http/HTTPClient.java b/source/net/yacy/cora/protocol/http/HTTPClient.java index 7f665822d..6f2b03ab5 100644 --- a/source/net/yacy/cora/protocol/http/HTTPClient.java +++ b/source/net/yacy/cora/protocol/http/HTTPClient.java @@ -82,6 +82,7 @@ import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.socket.ConnectionSocketFactory; import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.content.ContentBody; @@ -621,7 +622,7 @@ public class HTTPClient { final HttpEntity httpEntity = this.httpResponse.getEntity(); if (httpEntity != null && httpEntity.isStreaming()) { // Ensures that the entity content is fully consumed and the content stream, if exists, is closed. - EntityUtils.consume(httpEntity); + EntityUtils.consumeQuietly(httpEntity); } this.httpResponse.close(); } @@ -789,7 +790,7 @@ public class HTTPClient { final SSLConnectionSocketFactory sslSF = new SSLConnectionSocketFactory( sslContext, - SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + new NoopHostnameVerifier()); return sslSF; }