ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject incubator-ignite git commit: # Avast problem: disabled HTTP in IgniteUtils.
Date Fri, 20 Feb 2015 07:24:53 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-avast [created] 94ff55115


# Avast problem: disabled HTTP in IgniteUtils.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/94ff5511
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/94ff5511
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/94ff5511

Branch: refs/heads/ignite-avast
Commit: 94ff55115f50d66b4597a38962ae1d6499316f60
Parents: 76e203b
Author: vozerov <vozerov@gridgain.com>
Authored: Fri Feb 20 10:24:46 2015 +0300
Committer: vozerov <vozerov@gridgain.com>
Committed: Fri Feb 20 10:24:46 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       | 93 ++++++++++----------
 1 file changed, 47 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/94ff5511/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 5db0da4..5397dc0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -442,13 +442,13 @@ public abstract class IgniteUtils {
         SUN_REFLECT_FACTORY = refFac;
 
         // Disable hostname SSL verification for development and testing with self-signed
certificates.
-        if (Boolean.parseBoolean(System.getProperty(IGNITE_DISABLE_HOSTNAME_VERIFIER))) {
-            HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
-                @Override public boolean verify(String hostname, SSLSession sslSes) {
-                    return true;
-                }
-            });
-        }
+//        if (Boolean.parseBoolean(System.getProperty(IGNITE_DISABLE_HOSTNAME_VERIFIER)))
{
+//            HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
+//                @Override public boolean verify(String hostname, SSLSession sslSes) {
+//                    return true;
+//                }
+//            });
+//        }
 
         // Event names initialization.
         for (Field field : EventType.class.getFields()) {
@@ -1756,45 +1756,46 @@ public abstract class IgniteUtils {
      * @throws IOException If error occurred.
      */
     public static File downloadUrl(URL url, File file) throws IOException {
-        assert url != null;
-        assert file != null;
-
-        InputStream in = null;
-        OutputStream out = null;
-
-        try {
-            URLConnection conn = url.openConnection();
-
-            if (conn instanceof HttpsURLConnection) {
-                HttpsURLConnection https = (HttpsURLConnection)conn;
-
-                https.setHostnameVerifier(new DeploymentHostnameVerifier());
-
-                SSLContext ctx = SSLContext.getInstance(HTTPS_PROTOCOL);
-
-                ctx.init(null, getTrustManagers(), null);
-
-                // Initialize socket factory.
-                https.setSSLSocketFactory(ctx.getSocketFactory());
-            }
-
-            in = conn.getInputStream();
-
-            if (in == null)
-                throw new IOException("Failed to open connection: " + url.toString());
-
-            out = new BufferedOutputStream(new FileOutputStream(file));
-
-            copy(in, out);
-        }
-        catch (NoSuchAlgorithmException | KeyManagementException e) {
-            throw new IOException("Failed to open HTTPs connection [url=" + url.toString()
+ ", msg=" + e + ']', e);
-        } finally {
-            close(in, null);
-            close(out, null);
-        }
-
-        return file;
+//        assert url != null;
+//        assert file != null;
+//
+//        InputStream in = null;
+//        OutputStream out = null;
+//
+//        try {
+//            URLConnection conn = url.openConnection();
+//
+//            if (conn instanceof HttpsURLConnection) {
+//                HttpsURLConnection https = (HttpsURLConnection)conn;
+//
+//                https.setHostnameVerifier(new DeploymentHostnameVerifier());
+//
+//                SSLContext ctx = SSLContext.getInstance(HTTPS_PROTOCOL);
+//
+//                ctx.init(null, getTrustManagers(), null);
+//
+//                // Initialize socket factory.
+//                https.setSSLSocketFactory(ctx.getSocketFactory());
+//            }
+//
+//            in = conn.getInputStream();
+//
+//            if (in == null)
+//                throw new IOException("Failed to open connection: " + url.toString());
+//
+//            out = new BufferedOutputStream(new FileOutputStream(file));
+//
+//            copy(in, out);
+//        }
+//        catch (NoSuchAlgorithmException | KeyManagementException e) {
+//            throw new IOException("Failed to open HTTPs connection [url=" + url.toString()
+ ", msg=" + e + ']', e);
+//        } finally {
+//            close(in, null);
+//            close(out, null);
+//        }
+//
+//        return file;
+        return null;
     }
 
     /**


Mime
View raw message