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.unity3d.player.UnityWebRequest.runSafe() calling method javax.net.ssl.HttpsURLConnection.setHostnameVerifier()


    private void runSafe()
    {
        this.g = System.currentTimeMillis();
        try {
            long v0_32 = new java.net.URL(this.b);
            boolean v1_6 = v0_32.openConnection();
            v1_6.setConnectTimeout(this.f);
            v1_6.setReadTimeout(this.f);
            java.io.InputStream v3 = 0;
        } catch (long v0_30) {
            this.malformattedUrlCallback(v0_30.toString());
            return;
        } catch (long v0_23) {
            this.errorCallback(v0_23.toString());
            return;
        }
        if ((v1_6 instanceof javax.net.ssl.HttpsURLConnection)) {
            javax.net.ssl.SSLSocketFactory v4_1;
            boolean v2_7 = ((javax.net.ssl.HttpsURLConnection) v1_6);
            if (!this.e) {
                v4_1 = 0;
            } else {
                v4_1 = new com.unity3d.player.UnityWebRequest$2(this);
                v2_7.setHostnameVerifier(com.unity3d.player.UnityWebRequest.k);
            }
            javax.net.ssl.SSLSocketFactory v4_3 = com.unity3d.player.b.a(v4_1);
            if (v4_3 != null) {
                v2_7.setSSLSocketFactory(v4_3);
            }
        }
        if ((!v0_32.getProtocol().equalsIgnoreCase("file")) || (v0_32.getHost().isEmpty())) {
            boolean v2_17 = (v1_6 instanceof java.net.HttpURLConnection);
            if (v2_17) {
                try {
                    java.nio.ByteBuffer v5_2 = ((java.net.HttpURLConnection) v1_6);
                    v5_2.setRequestMethod(this.c);
                    v5_2.setInstanceFollowRedirects(0);
                } catch (long v0_33) {
                    this.badProtocolCallback(v0_33.toString());
                    return;
                }
                if (this.h > 0) {
                    if (!this.j) {
                        v5_2.setFixedLengthStreamingMode(((int) this.h));
                    } else {
                        v5_2.setChunkedStreamingMode(0);
                    }
                    if (this.i) {
                        v5_2.addRequestProperty("Expect", "100-continue");
                    }
                }
            }
            java.nio.ByteBuffer v5_3 = this.d;
            if (v5_3 != null) {
                java.nio.ByteBuffer v5_5 = v5_3.entrySet().iterator();
                while (v5_5.hasNext()) {
                    String v6_13 = ((java.util.Map$Entry) v5_5.next());
                    v1_6.addRequestProperty(((String) v6_13.getKey()), ((String) v6_13.getValue()));
                }
            }
            java.nio.ByteBuffer v5_7 = java.nio.ByteBuffer.allocateDirect(131072);
            if (this.uploadCallback(0) > 0) {
                v1_6.setDoOutput(1);
                try {
                    String v6_25 = v1_6.getOutputStream();
                } catch (long v0_25) {
                    this.errorCallback(v0_25.toString());
                    return;
                }
                while(true) {
                    int v9_1 = this.uploadCallback(v5_7);
                    if (v9_1 <= 0) {
                        break;
                    }
                    if (!this.hasTimedOut()) {
                        v6_25.write(v5_7.array(), v5_7.arrayOffset(), v9_1);
                    } else {
                        v6_25.close();
                        com.unity3d.player.UnityWebRequest.errorCallback(this.a, 14, "WebRequest timed out.");
                        return;
                    }
                }
            }
            if (v2_17) {
                try {
                    this.responseCodeCallback(((java.net.HttpURLConnection) v1_6).getResponseCode());
                } catch (long v0_6) {
                    this.unknownHostCallback(v0_6.toString());
                    return;
                } catch (long v0_5) {
                    this.sslCannotConnectCallback(v0_5);
                    return;
                } catch (long v0_3) {
                    com.unity3d.player.UnityWebRequest.errorCallback(this.a, 14, v0_3.toString());
                    return;
                } catch (long v0_1) {
                    this.errorCallback(v0_1.toString());
                    return;
                }
            }
            boolean v2_5 = v1_6.getHeaderFields();
            this.headerCallback(v2_5);
            if (((!v2_5) || (!v2_5.containsKey("content-length"))) && (v1_6.getContentLength() != -1)) {
                this.headerCallback("content-length", String.valueOf(v1_6.getContentLength()));
            }
            if (((!v2_5) || (!v2_5.containsKey("content-type"))) && (v1_6.getContentType() != null)) {
                this.headerCallback("content-type", v1_6.getContentType());
            }
            if ((v2_5) && ((v2_5.containsKey("Set-Cookie")) && ((java.net.CookieHandler.getDefault() != null) && ((java.net.CookieHandler.getDefault() instanceof java.net.CookieManager))))) {
                java.net.CookieStore v10_13 = ((java.net.CookieManager) java.net.CookieHandler.getDefault()).getCookieStore();
                boolean v2_10 = ((java.util.List) v2_5.get("Set-Cookie")).iterator();
                while (v2_10.hasNext()) {
                    try {
                        String v6_8 = ((java.net.HttpCookie) java.net.HttpCookie.parse(((String) v2_10.next())).get(0));
                    } catch (String v6_9) {
                        String v12_3 = new StringBuilder("UnityWebRequest: error constructing URI: ");
                        v12_3.append(v6_9.getMessage());
                        com.unity3d.player.g.Log(6, v12_3.toString());
                    }
                    if ((v6_8.getPath() != null) && ((!v6_8.getPath().equals("")) && ((v6_8.getDomain() == null) || (v6_8.getDomain().equals(v0_32.getHost()))))) {
                        java.net.URI v11_8 = new java.net.URI(v0_32.getProtocol(), v0_32.getHost(), v6_8.getPath(), 0);
                        v6_8.setDomain(v0_32.getHost());
                        v10_13.add(v11_8, v6_8);
                    }
                }
            }
            this.contentLengthCallback(v1_6.getContentLength());
            try {
                if ((v1_6 instanceof java.net.HttpURLConnection)) {
                    long v0_11 = ((java.net.HttpURLConnection) v1_6);
                    this.responseCodeCallback(v0_11.getResponseCode());
                    v3 = v0_11.getErrorStream();
                }
            } catch (long v0_21) {
                this.unknownHostCallback(v0_21.toString());
                return;
            } catch (long v0_20) {
                this.sslCannotConnectCallback(v0_20);
                return;
            } catch (long v0_18) {
                com.unity3d.player.UnityWebRequest.errorCallback(this.a, 14, v0_18.toString());
                return;
            } catch (long v0_16) {
                com.unity3d.player.UnityWebRequest.errorCallback(this.a, 14, v0_16.toString());
                return;
            } catch (long v0_14) {
                this.errorCallback(v0_14.toString());
                return;
            }
            if (v3 == null) {
                v3 = v1_6.getInputStream();
            }
            long v0_12 = java.nio.channels.Channels.newChannel(v3);
            while(true) {
                boolean v1_1 = v0_12.read(v5_7);
                if (v1_1 == -1) {
                    break;
                }
                if (!this.hasTimedOut()) {
                    if (!this.downloadCallback(v5_7, v1_1)) {
                        break;
                    }
                    v5_7.clear();
                } else {
                    v0_12.close();
                    com.unity3d.player.UnityWebRequest.errorCallback(this.a, 14, "WebRequest timed out.");
                    return;
                }
            }
            v0_12.close();
            return;
        } else {
            this.malformattedUrlCallback("file:// must use an absolute path");
            return;
        }
    }