diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2017-12-02 00:03:42 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-12-13 01:08:23 +0100 |
commit | e3b3c0431e9fa5174b90573a4aa9d84efef2c822 (patch) | |
tree | 6ebc40b1ad1dd2fd24ec95cccc1003d12a93736f /org.eclipse.jgit.http.apache | |
parent | e1fb47bd554ac3abcd10164bd234ad91d4654b4a (diff) | |
download | jgit-e3b3c0431e9fa5174b90573a4aa9d84efef2c822.tar.gz jgit-e3b3c0431e9fa5174b90573a4aa9d84efef2c822.zip |
Remove use of deprecated X509HostnameVerifier
Change-Id: I318f5457ade3d11b2ac1c99f6ef382a0a147a352
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.http.apache')
-rw-r--r-- | org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java index 945ecd5812..54258fe8a3 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java @@ -58,7 +58,6 @@ import java.net.URL; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; -import java.security.cert.X509Certificate; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -67,9 +66,6 @@ import java.util.Map; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocket; import javax.net.ssl.TrustManager; import org.apache.http.Header; @@ -91,7 +87,6 @@ import org.apache.http.config.RegistryBuilder; import org.apache.http.conn.socket.ConnectionSocketFactory; import org.apache.http.conn.socket.PlainConnectionSocketFactory; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.X509HostnameVerifier; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.BasicHttpClientConnectionManager; @@ -128,7 +123,7 @@ public class HttpClientConnection implements HttpConnection { private Boolean followRedirects; - private X509HostnameVerifier hostnameverifier; + private HostnameVerifier hostnameverifier; SSLContext ctx; @@ -398,29 +393,7 @@ public class HttpClientConnection implements HttpConnection { @Override public void setHostnameVerifier(final HostnameVerifier hostnameverifier) { - this.hostnameverifier = new X509HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return hostnameverifier.verify(hostname, session); - } - - @Override - public void verify(String host, String[] cns, String[] subjectAlts) - throws SSLException { - throw new UnsupportedOperationException(); // TODO message - } - - @Override - public void verify(String host, X509Certificate cert) - throws SSLException { - throw new UnsupportedOperationException(); // TODO message - } - - @Override - public void verify(String host, SSLSocket ssl) throws IOException { - hostnameverifier.verify(host, ssl.getSession()); - } - }; + this.hostnameverifier = hostnameverifier; } @Override |