Info Call to SSL/TLS API

Description

List of all files shipped in the application.

Recommendation

This entry is informative, no recommendations applicable.

References
Technical details

Method com.here.network.NetworkProtocol$GetTask.doInBackground() calling method javax.net.ssl.HttpsURLConnection.setHostnameVerifier()


    protected varargs Void doInBackground(com.here.network.NetworkProtocol$Request[] p21)
    {
        int v11 = 0;
        while (v11 < p21.length) {
            try {
                int v10_0;
                com.here.network.NetworkProtocol$Request v18 = p21[v11];
                com.here.network.NetworkProtocol v2_8 = new java.net.URL(v18.url());
            } catch (com.here.network.NetworkProtocol v2_56) {
                int v12 = 0;
                this.cleanup(v12);
                throw v2_56;
            } catch (com.here.network.NetworkProtocol v2_62) {
                int v6_8 = v2_62;
                int v10_1 = 0;
                try {
                    android.util.Log.e("NetworkProtocol", new StringBuilder().append("NetworkProtocol::GetTask::run exception: ").append(v6_8).toString());
                    v6_8.printStackTrace();
                    com.here.network.NetworkProtocol.access$000(this.this$0, p21[v11].clientId(), p21[v11].requestId(), -1, v6_8.toString(), 0, "", "");
                    this.cleanup(v10_1);
                } catch (com.here.network.NetworkProtocol v2_56) {
                    v12 = v10_1;
                }
                v11++;
            }
            if (!v18.hasProxy()) {
                v10_0 = v2_8.openConnection();
            } else {
                if (!v18.noProxy()) {
                    v10_0 = v2_8.openConnection(new java.net.Proxy(java.net.Proxy$Type.HTTP, new java.net.InetSocketAddress(v18.proxyServer(), v18.proxyPort())));
                } else {
                    v10_0 = v2_8.openConnection(java.net.Proxy.NO_PROXY);
                }
            }
            if ((v10_0 instanceof javax.net.ssl.HttpsURLConnection)) {
                com.here.network.NetworkProtocol v2_54 = ((javax.net.ssl.HttpsURLConnection) v10_0);
                int v4_28 = 0;
                if (!v18.certificatePath().isEmpty()) {
                    v4_28 = com.here.network.NetworkSSLContextFactory.getInstance().getSSLContext(v18.certificatePath());
                    if (v4_28 == 0) {
                        android.util.Log.e("NetworkProtocol", new StringBuilder().append("NetworkProtocol::GetTask::run failed to create ssl context, certificate path is set to ? ").append(v18.certificatePath()).toString());
                    }
                }
                if (v4_28 == 0) {
                    if (v18.ignoreCertificate()) {
                        v2_54.setSSLSocketFactory(android.net.SSLCertificateSocketFactory.getInsecure(0, 0));
                        v2_54.setHostnameVerifier(new org.apache.http.conn.ssl.AllowAllHostnameVerifier());
                    }
                } else {
                    v2_54.setSSLSocketFactory(v4_28.getSocketFactory());
                }
            }
            if (!(v10_0 instanceof java.net.HttpURLConnection)) {
                v12 = 0;
            } else {
                v12 = ((java.net.HttpURLConnection) v10_0);
            }
            try {
                if (v12 != 0) {
                    if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.HEAD) {
                        if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.PUT) {
                            if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.DELETE) {
                                if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.POST) {
                                    v12.setRequestMethod("GET");
                                } else {
                                    v12.setRequestMethod("POST");
                                }
                            } else {
                                v12.setRequestMethod("DELETE");
                            }
                        } else {
                            v12.setRequestMethod("PUT");
                        }
                    } else {
                        v12.setRequestMethod("HEAD");
                    }
                }
                int v4_1 = v18.headers();
                com.here.network.NetworkProtocol v2_9 = 0;
                if (v4_1 != 0) {
                    int v3_3 = 0;
                    while ((v3_3 + 1) < v4_1.length) {
                        v10_0.addRequestProperty(v4_1[v3_3], v4_1[(v3_3 + 1)]);
                        if (v4_1[v3_3].compareToIgnoreCase("If-None-Match") == 0) {
                            v2_9 = 1;
                        }
                        v3_3 += 2;
                    }
                }
                v10_0.setUseCaches(0);
                v10_0.setConnectTimeout((v18.connectTimeout() * 1000));
                v10_0.setReadTimeout((v18.requestTimeout() * 1000));
                if ((v18.verb() != com.here.network.NetworkProtocol$HttpVerb.HEAD) && (v12 != 0)) {
                    if (v18.postData() == null) {
                        v12.setChunkedStreamingMode(8192);
                    } else {
                        v12.setFixedLengthStreamingMode(v18.postData().length);
                    }
                }
                if ((android.os.Build$VERSION.SDK_INT < 21) && ((v18.verb() == com.here.network.NetworkProtocol$HttpVerb.HEAD) || (v2_9 != null))) {
                    v10_0.setRequestProperty("Accept-Encoding", "");
                }
                v10_0.setRequestProperty("Connection", "Close");
                v10_0.setDoInput(1);
                if (v18.postData() == null) {
                    v10_0.setDoOutput(0);
                } else {
                    v10_0.setDoOutput(1);
                    v10_0.getOutputStream().write(v18.postData());
                }
                int v17;
                String v16;
                if (v12 == 0) {
                    v16 = "";
                    v17 = 0;
                } else {
                    v16 = v12.getResponseMessage();
                    v17 = v12.getResponseCode();
                }
                if (!this.isCancelled()) {
                    String v15;
                    com.here.network.NetworkProtocol v2_21 = v10_0.getHeaderField("ETag");
                    if (v2_21 != null) {
                        v15 = v2_21;
                    } else {
                        v15 = "";
                    }
                    String v14;
                    com.here.network.NetworkProtocol v2_24 = v10_0.getHeaderField("Content-Type");
                    if (v2_24 != null) {
                        v14 = v2_24;
                    } else {
                        v14 = "";
                    }
                    int v13;
                    int v6_1 = v10_0.getHeaderFieldDate("Date", 0);
                    int v3_22 = v10_0.getHeaderField("Cache-Control");
                    if (v3_22 == 0) {
                        v13 = 0;
                    } else {
                        int v4_10 = v3_22.indexOf("max-age=");
                        if (v4_10 < 0) {
                        } else {
                            int v3_23;
                            int v4_11 = (v4_10 + 8);
                            com.here.network.NetworkProtocol v5_3 = v3_22.indexOf(44, v4_11);
                            try {
                                if (v5_3 <= v4_11) {
                                    v3_23 = v3_22.substring(v4_11);
                                } else {
                                    v3_23 = v3_22.substring(v4_11, v5_3);
                                }
                                v13 = Integer.parseInt(v3_23);
                            } catch (int v3) {
                                v13 = 0;
                            }
                        }
                    }
                    String v8_0 = 0;
                    com.here.network.NetworkProtocol v2_30 = v10_0.getHeaderField("Content-Range");
                    if (v2_30 != null) {
                        int v3_25 = v2_30.indexOf("bytes ");
                        if (v3_25 >= 0) {
                            com.here.network.NetworkProtocol v2_31;
                            int v3_26 = (v3_25 + 6);
                            int v4_13 = v2_30.indexOf(45, v3_26);
                            try {
                                if (v4_13 <= v3_26) {
                                    v2_31 = v2_30.substring(v3_26);
                                } else {
                                    v2_31 = v2_30.substring(v3_26, v4_13);
                                }
                                v8_0 = Long.parseLong(v2_31);
                            } catch (com.here.network.NetworkProtocol v2_32) {
                                android.util.Log.d("NetworkProtocol", new StringBuilder().append("parseInt: ").append(v2_32).toString());
                            }
                        }
                    }
                    int v3_28 = 0;
                    while (v10_0.getHeaderFieldKey(v3_28) != null) {
                        v3_28++;
                    }
                    int v4_17 = new String[(v3_28 * 2)];
                    com.here.network.NetworkProtocol v2_38 = 0;
                    while (v2_38 < v3_28) {
                        v4_17[(v2_38 * 2)] = v10_0.getHeaderFieldKey(v2_38);
                        v4_17[((v2_38 * 2) + 1)] = v10_0.getHeaderField(v2_38);
                        v2_38++;
                    }
                    if (!this.isCancelled()) {
                        com.here.network.NetworkProtocol.access$100(this.this$0, v18.clientId(), v18.requestId(), v4_17);
                        com.here.network.NetworkProtocol.access$200(this.this$0, v18.clientId(), v18.requestId(), v6_1, v8_0);
                        try {
                            com.here.network.NetworkProtocol v2_42 = new java.io.BufferedInputStream(v10_0.getInputStream());
                        } catch (com.here.network.NetworkProtocol v2_43) {
                            if (v12 == 0) {
                                throw v2_43;
                            } else {
                                v2_42 = new java.io.BufferedInputStream(v12.getErrorStream());
                            }
                        } catch (com.here.network.NetworkProtocol v2_46) {
                            if (v17 != 0) {
                                if (!this.isCancelled()) {
                                    com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), v17, v16, v13, v15, v14);
                                } else {
                                    com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), -5, "Cancelled", 0, "", "");
                                }
                                this.cleanup(v12);
                            } else {
                                throw v2_46;
                            }
                        }
                        int v3_34 = new byte[8192];
                        while (!this.isCancelled()) {
                            int v4_21 = v2_42.read(v3_34);
                            if (v4_21 < 0) {
                                break;
                            }
                            com.here.network.NetworkProtocol.access$300(this.this$0, v18.clientId(), v18.requestId(), v3_34, v4_21);
                        }
                    } else {
                        this.cleanup(v12);
                        com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), -5, "Cancelled", 0, "", "");
                        this.cleanup(v12);
                    }
                } else {
                    this.cleanup(v12);
                    com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), -5, "Cancelled", 0, "", "");
                    this.cleanup(v12);
                }
            } catch (com.here.network.NetworkProtocol v2_56) {
            }
        }
        return 0;
    }

Method com.here.network.NetworkProtocol$GetTask.doInBackground() calling method android.net.SSLCertificateSocketFactory.getInsecure()


    protected varargs Void doInBackground(com.here.network.NetworkProtocol$Request[] p21)
    {
        int v11 = 0;
        while (v11 < p21.length) {
            try {
                int v10_0;
                com.here.network.NetworkProtocol$Request v18 = p21[v11];
                com.here.network.NetworkProtocol v2_8 = new java.net.URL(v18.url());
            } catch (com.here.network.NetworkProtocol v2_56) {
                int v12 = 0;
                this.cleanup(v12);
                throw v2_56;
            } catch (com.here.network.NetworkProtocol v2_62) {
                int v6_8 = v2_62;
                int v10_1 = 0;
                try {
                    android.util.Log.e("NetworkProtocol", new StringBuilder().append("NetworkProtocol::GetTask::run exception: ").append(v6_8).toString());
                    v6_8.printStackTrace();
                    com.here.network.NetworkProtocol.access$000(this.this$0, p21[v11].clientId(), p21[v11].requestId(), -1, v6_8.toString(), 0, "", "");
                    this.cleanup(v10_1);
                } catch (com.here.network.NetworkProtocol v2_56) {
                    v12 = v10_1;
                }
                v11++;
            }
            if (!v18.hasProxy()) {
                v10_0 = v2_8.openConnection();
            } else {
                if (!v18.noProxy()) {
                    v10_0 = v2_8.openConnection(new java.net.Proxy(java.net.Proxy$Type.HTTP, new java.net.InetSocketAddress(v18.proxyServer(), v18.proxyPort())));
                } else {
                    v10_0 = v2_8.openConnection(java.net.Proxy.NO_PROXY);
                }
            }
            if ((v10_0 instanceof javax.net.ssl.HttpsURLConnection)) {
                com.here.network.NetworkProtocol v2_54 = ((javax.net.ssl.HttpsURLConnection) v10_0);
                int v4_28 = 0;
                if (!v18.certificatePath().isEmpty()) {
                    v4_28 = com.here.network.NetworkSSLContextFactory.getInstance().getSSLContext(v18.certificatePath());
                    if (v4_28 == 0) {
                        android.util.Log.e("NetworkProtocol", new StringBuilder().append("NetworkProtocol::GetTask::run failed to create ssl context, certificate path is set to ? ").append(v18.certificatePath()).toString());
                    }
                }
                if (v4_28 == 0) {
                    if (v18.ignoreCertificate()) {
                        v2_54.setSSLSocketFactory(android.net.SSLCertificateSocketFactory.getInsecure(0, 0));
                        v2_54.setHostnameVerifier(new org.apache.http.conn.ssl.AllowAllHostnameVerifier());
                    }
                } else {
                    v2_54.setSSLSocketFactory(v4_28.getSocketFactory());
                }
            }
            if (!(v10_0 instanceof java.net.HttpURLConnection)) {
                v12 = 0;
            } else {
                v12 = ((java.net.HttpURLConnection) v10_0);
            }
            try {
                if (v12 != 0) {
                    if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.HEAD) {
                        if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.PUT) {
                            if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.DELETE) {
                                if (v18.verb() != com.here.network.NetworkProtocol$HttpVerb.POST) {
                                    v12.setRequestMethod("GET");
                                } else {
                                    v12.setRequestMethod("POST");
                                }
                            } else {
                                v12.setRequestMethod("DELETE");
                            }
                        } else {
                            v12.setRequestMethod("PUT");
                        }
                    } else {
                        v12.setRequestMethod("HEAD");
                    }
                }
                int v4_1 = v18.headers();
                com.here.network.NetworkProtocol v2_9 = 0;
                if (v4_1 != 0) {
                    int v3_3 = 0;
                    while ((v3_3 + 1) < v4_1.length) {
                        v10_0.addRequestProperty(v4_1[v3_3], v4_1[(v3_3 + 1)]);
                        if (v4_1[v3_3].compareToIgnoreCase("If-None-Match") == 0) {
                            v2_9 = 1;
                        }
                        v3_3 += 2;
                    }
                }
                v10_0.setUseCaches(0);
                v10_0.setConnectTimeout((v18.connectTimeout() * 1000));
                v10_0.setReadTimeout((v18.requestTimeout() * 1000));
                if ((v18.verb() != com.here.network.NetworkProtocol$HttpVerb.HEAD) && (v12 != 0)) {
                    if (v18.postData() == null) {
                        v12.setChunkedStreamingMode(8192);
                    } else {
                        v12.setFixedLengthStreamingMode(v18.postData().length);
                    }
                }
                if ((android.os.Build$VERSION.SDK_INT < 21) && ((v18.verb() == com.here.network.NetworkProtocol$HttpVerb.HEAD) || (v2_9 != null))) {
                    v10_0.setRequestProperty("Accept-Encoding", "");
                }
                v10_0.setRequestProperty("Connection", "Close");
                v10_0.setDoInput(1);
                if (v18.postData() == null) {
                    v10_0.setDoOutput(0);
                } else {
                    v10_0.setDoOutput(1);
                    v10_0.getOutputStream().write(v18.postData());
                }
                int v17;
                String v16;
                if (v12 == 0) {
                    v16 = "";
                    v17 = 0;
                } else {
                    v16 = v12.getResponseMessage();
                    v17 = v12.getResponseCode();
                }
                if (!this.isCancelled()) {
                    String v15;
                    com.here.network.NetworkProtocol v2_21 = v10_0.getHeaderField("ETag");
                    if (v2_21 != null) {
                        v15 = v2_21;
                    } else {
                        v15 = "";
                    }
                    String v14;
                    com.here.network.NetworkProtocol v2_24 = v10_0.getHeaderField("Content-Type");
                    if (v2_24 != null) {
                        v14 = v2_24;
                    } else {
                        v14 = "";
                    }
                    int v13;
                    int v6_1 = v10_0.getHeaderFieldDate("Date", 0);
                    int v3_22 = v10_0.getHeaderField("Cache-Control");
                    if (v3_22 == 0) {
                        v13 = 0;
                    } else {
                        int v4_10 = v3_22.indexOf("max-age=");
                        if (v4_10 < 0) {
                        } else {
                            int v3_23;
                            int v4_11 = (v4_10 + 8);
                            com.here.network.NetworkProtocol v5_3 = v3_22.indexOf(44, v4_11);
                            try {
                                if (v5_3 <= v4_11) {
                                    v3_23 = v3_22.substring(v4_11);
                                } else {
                                    v3_23 = v3_22.substring(v4_11, v5_3);
                                }
                                v13 = Integer.parseInt(v3_23);
                            } catch (int v3) {
                                v13 = 0;
                            }
                        }
                    }
                    String v8_0 = 0;
                    com.here.network.NetworkProtocol v2_30 = v10_0.getHeaderField("Content-Range");
                    if (v2_30 != null) {
                        int v3_25 = v2_30.indexOf("bytes ");
                        if (v3_25 >= 0) {
                            com.here.network.NetworkProtocol v2_31;
                            int v3_26 = (v3_25 + 6);
                            int v4_13 = v2_30.indexOf(45, v3_26);
                            try {
                                if (v4_13 <= v3_26) {
                                    v2_31 = v2_30.substring(v3_26);
                                } else {
                                    v2_31 = v2_30.substring(v3_26, v4_13);
                                }
                                v8_0 = Long.parseLong(v2_31);
                            } catch (com.here.network.NetworkProtocol v2_32) {
                                android.util.Log.d("NetworkProtocol", new StringBuilder().append("parseInt: ").append(v2_32).toString());
                            }
                        }
                    }
                    int v3_28 = 0;
                    while (v10_0.getHeaderFieldKey(v3_28) != null) {
                        v3_28++;
                    }
                    int v4_17 = new String[(v3_28 * 2)];
                    com.here.network.NetworkProtocol v2_38 = 0;
                    while (v2_38 < v3_28) {
                        v4_17[(v2_38 * 2)] = v10_0.getHeaderFieldKey(v2_38);
                        v4_17[((v2_38 * 2) + 1)] = v10_0.getHeaderField(v2_38);
                        v2_38++;
                    }
                    if (!this.isCancelled()) {
                        com.here.network.NetworkProtocol.access$100(this.this$0, v18.clientId(), v18.requestId(), v4_17);
                        com.here.network.NetworkProtocol.access$200(this.this$0, v18.clientId(), v18.requestId(), v6_1, v8_0);
                        try {
                            com.here.network.NetworkProtocol v2_42 = new java.io.BufferedInputStream(v10_0.getInputStream());
                        } catch (com.here.network.NetworkProtocol v2_43) {
                            if (v12 == 0) {
                                throw v2_43;
                            } else {
                                v2_42 = new java.io.BufferedInputStream(v12.getErrorStream());
                            }
                        } catch (com.here.network.NetworkProtocol v2_46) {
                            if (v17 != 0) {
                                if (!this.isCancelled()) {
                                    com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), v17, v16, v13, v15, v14);
                                } else {
                                    com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), -5, "Cancelled", 0, "", "");
                                }
                                this.cleanup(v12);
                            } else {
                                throw v2_46;
                            }
                        }
                        int v3_34 = new byte[8192];
                        while (!this.isCancelled()) {
                            int v4_21 = v2_42.read(v3_34);
                            if (v4_21 < 0) {
                                break;
                            }
                            com.here.network.NetworkProtocol.access$300(this.this$0, v18.clientId(), v18.requestId(), v3_34, v4_21);
                        }
                    } else {
                        this.cleanup(v12);
                        com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), -5, "Cancelled", 0, "", "");
                        this.cleanup(v12);
                    }
                } else {
                    this.cleanup(v12);
                    com.here.network.NetworkProtocol.access$000(this.this$0, v18.clientId(), v18.requestId(), -5, "Cancelled", 0, "", "");
                    this.cleanup(v12);
                }
            } catch (com.here.network.NetworkProtocol v2_56) {
            }
        }
        return 0;
    }