{"action":"created","comment":{"url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/comments/67069135","id":67069135,"diff_hunk":"@@ -173,13 +179,22 @@ private ServerResponse make_restful_get(String baseUrl, JSONObject params, Strin\n         }\n \n         try {\n+            modifiedUrl = getResolvedApiUrl(modifiedUrl);\n             if (log) PrefHelper.Debug(\"BranchSDK\", \"getting \" + modifiedUrl);\n             lastRoundTripTime_ = 0;\n             long reqStartTime = System.currentTimeMillis();\n             URL urlObject = new URL(modifiedUrl);\n-            connection = (HttpURLConnection) urlObject.openConnection();\n+            connection = (HttpsURLConnection) urlObject.openConnection();\n             connection.setConnectTimeout(timeout);\n             connection.setReadTimeout(timeout);\n+            // Default host verifier will provide SSL error on host verification since ip used in request is not mapped to a certificate\n+            connection.setHostnameVerifier(new HostnameVerifier() {","path":"Branch-SDK/src/io/branch/referral/RemoteInterface.java","position":42,"original_position":42,"commit_id":"f392ca3eb94545ba38a3e277d14cc87c76d14c1d","original_commit_id":"f392ca3eb94545ba38a3e277d14cc87c76d14c1d","user":{"login":"sojanpr","id":7651572,"avatar_url":"https://avatars.githubusercontent.com/u/7651572?v=3","gravatar_id":"","url":"https://api.github.com/users/sojanpr","html_url":"https://github.com/sojanpr","followers_url":"https://api.github.com/users/sojanpr/followers","following_url":"https://api.github.com/users/sojanpr/following{/other_user}","gists_url":"https://api.github.com/users/sojanpr/gists{/gist_id}","starred_url":"https://api.github.com/users/sojanpr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sojanpr/subscriptions","organizations_url":"https://api.github.com/users/sojanpr/orgs","repos_url":"https://api.github.com/users/sojanpr/repos","events_url":"https://api.github.com/users/sojanpr/events{/privacy}","received_events_url":"https://api.github.com/users/sojanpr/received_events","type":"User","site_admin":false},"body":"Android internally check certificate for any secure connection. The way it find the SSL certificate is using the CommonName of the host. When we change the host with its IP Android won't be able to  verify SSL and throw `hostNotVerified` exception. This code will override Android SSL check and return it as always verified","created_at":"2016-06-14T22:25:17Z","updated_at":"2016-06-14T22:25:17Z","html_url":"https://github.com/BranchMetrics/android-branch-deep-linking/pull/255#discussion_r67069135","pull_request_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255","_links":{"self":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/comments/67069135"},"html":{"href":"https://github.com/BranchMetrics/android-branch-deep-linking/pull/255#discussion_r67069135"},"pull_request":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255"}}},"pull_request":{"url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255","id":73791258,"html_url":"https://github.com/BranchMetrics/android-branch-deep-linking/pull/255","diff_url":"https://github.com/BranchMetrics/android-branch-deep-linking/pull/255.diff","patch_url":"https://github.com/BranchMetrics/android-branch-deep-linking/pull/255.patch","issue_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/255","number":255,"state":"open","locked":false,"title":"Improved Branch request handling in slow network","user":{"login":"sojanpr","id":7651572,"avatar_url":"https://avatars.githubusercontent.com/u/7651572?v=3","gravatar_id":"","url":"https://api.github.com/users/sojanpr","html_url":"https://github.com/sojanpr","followers_url":"https://api.github.com/users/sojanpr/followers","following_url":"https://api.github.com/users/sojanpr/following{/other_user}","gists_url":"https://api.github.com/users/sojanpr/gists{/gist_id}","starred_url":"https://api.github.com/users/sojanpr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sojanpr/subscriptions","organizations_url":"https://api.github.com/users/sojanpr/orgs","repos_url":"https://api.github.com/users/sojanpr/repos","events_url":"https://api.github.com/users/sojanpr/events{/privacy}","received_events_url":"https://api.github.com/users/sojanpr/received_events","type":"User","site_admin":false},"body":"On slow networks If the hostname resolves to multiple IP addresses, URL\nconnection will attempt to connect the next if one connection fails.\nThis may result is multiple timeouts elapse before the connect attempt\nthrows an exception. In order to make sure the Branch callback is\ncalled with in the timeout specified we resolve the host first and then\ntry only with first resolved ip.\nThis will ensure that Branch Callbacks are retuned in the time out\nspecified (Default is 3sec sec and 3 attempts. so 9 sec max).\nThis fix will solve the issue “Branch init callback returned after\nlong wait on slow networks”\n\n@aaustin @Sarkar @EvangelosG @hubt ","created_at":"2016-06-14T18:37:38Z","updated_at":"2016-06-14T22:25:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5df1d4d48211fbfd9c64501e6841c7b592db7e4f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255/commits","review_comments_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255/comments","review_comment_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/255/comments","statuses_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/statuses/f392ca3eb94545ba38a3e277d14cc87c76d14c1d","head":{"label":"BranchMetrics:Slow-Network-Management","ref":"Slow-Network-Management","sha":"f392ca3eb94545ba38a3e277d14cc87c76d14c1d","user":{"login":"BranchMetrics","id":7772941,"avatar_url":"https://avatars.githubusercontent.com/u/7772941?v=3","gravatar_id":"","url":"https://api.github.com/users/BranchMetrics","html_url":"https://github.com/BranchMetrics","followers_url":"https://api.github.com/users/BranchMetrics/followers","following_url":"https://api.github.com/users/BranchMetrics/following{/other_user}","gists_url":"https://api.github.com/users/BranchMetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/BranchMetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BranchMetrics/subscriptions","organizations_url":"https://api.github.com/users/BranchMetrics/orgs","repos_url":"https://api.github.com/users/BranchMetrics/repos","events_url":"https://api.github.com/users/BranchMetrics/events{/privacy}","received_events_url":"https://api.github.com/users/BranchMetrics/received_events","type":"Organization","site_admin":false},"repo":{"id":20421659,"name":"android-branch-deep-linking","full_name":"BranchMetrics/android-branch-deep-linking","owner":{"login":"BranchMetrics","id":7772941,"avatar_url":"https://avatars.githubusercontent.com/u/7772941?v=3","gravatar_id":"","url":"https://api.github.com/users/BranchMetrics","html_url":"https://github.com/BranchMetrics","followers_url":"https://api.github.com/users/BranchMetrics/followers","following_url":"https://api.github.com/users/BranchMetrics/following{/other_user}","gists_url":"https://api.github.com/users/BranchMetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/BranchMetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BranchMetrics/subscriptions","organizations_url":"https://api.github.com/users/BranchMetrics/orgs","repos_url":"https://api.github.com/users/BranchMetrics/repos","events_url":"https://api.github.com/users/BranchMetrics/events{/privacy}","received_events_url":"https://api.github.com/users/BranchMetrics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BranchMetrics/android-branch-deep-linking","description":"Deferred Deep Linking SDK for Android apps powered by Branch Metrics. We help mobile apps grow with deep links / deeplinks that power referral systems, sharing links and invites with full attribution and analytics.","fork":false,"url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking","forks_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/forks","keys_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/teams","hooks_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/hooks","issue_events_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/events{/number}","events_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/events","assignees_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/assignees{/user}","branches_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/branches{/branch}","tags_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/tags","blobs_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/refs{/sha}","trees_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/statuses/{sha}","languages_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/languages","stargazers_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/stargazers","contributors_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/contributors","subscribers_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/subscribers","subscription_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/subscription","commits_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/commits{/sha}","git_commits_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/commits{/sha}","comments_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/comments{/number}","issue_comment_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/comments{/number}","contents_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/contents/{+path}","compare_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/merges","archive_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/downloads","issues_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues{/number}","pulls_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls{/number}","milestones_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/milestones{/number}","notifications_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/labels{/name}","releases_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/releases{/id}","deployments_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/deployments","created_at":"2014-06-02T22:17:59Z","updated_at":"2016-06-10T19:00:18Z","pushed_at":"2016-06-14T18:37:39Z","git_url":"git://github.com/BranchMetrics/android-branch-deep-linking.git","ssh_url":"git@github.com:BranchMetrics/android-branch-deep-linking.git","clone_url":"https://github.com/BranchMetrics/android-branch-deep-linking.git","svn_url":"https://github.com/BranchMetrics/android-branch-deep-linking","homepage":"https://dev.branch.io/references/android_sdk/","size":15354,"stargazers_count":72,"watchers_count":72,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":6,"forks":47,"open_issues":6,"watchers":72,"default_branch":"master"}},"base":{"label":"BranchMetrics:master","ref":"master","sha":"177c48f225052294826e571d088f181daff26600","user":{"login":"BranchMetrics","id":7772941,"avatar_url":"https://avatars.githubusercontent.com/u/7772941?v=3","gravatar_id":"","url":"https://api.github.com/users/BranchMetrics","html_url":"https://github.com/BranchMetrics","followers_url":"https://api.github.com/users/BranchMetrics/followers","following_url":"https://api.github.com/users/BranchMetrics/following{/other_user}","gists_url":"https://api.github.com/users/BranchMetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/BranchMetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BranchMetrics/subscriptions","organizations_url":"https://api.github.com/users/BranchMetrics/orgs","repos_url":"https://api.github.com/users/BranchMetrics/repos","events_url":"https://api.github.com/users/BranchMetrics/events{/privacy}","received_events_url":"https://api.github.com/users/BranchMetrics/received_events","type":"Organization","site_admin":false},"repo":{"id":20421659,"name":"android-branch-deep-linking","full_name":"BranchMetrics/android-branch-deep-linking","owner":{"login":"BranchMetrics","id":7772941,"avatar_url":"https://avatars.githubusercontent.com/u/7772941?v=3","gravatar_id":"","url":"https://api.github.com/users/BranchMetrics","html_url":"https://github.com/BranchMetrics","followers_url":"https://api.github.com/users/BranchMetrics/followers","following_url":"https://api.github.com/users/BranchMetrics/following{/other_user}","gists_url":"https://api.github.com/users/BranchMetrics/gists{/gist_id}","starred_url":"https://api.github.com/users/BranchMetrics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BranchMetrics/subscriptions","organizations_url":"https://api.github.com/users/BranchMetrics/orgs","repos_url":"https://api.github.com/users/BranchMetrics/repos","events_url":"https://api.github.com/users/BranchMetrics/events{/privacy}","received_events_url":"https://api.github.com/users/BranchMetrics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BranchMetrics/android-branch-deep-linking","description":"Deferred Deep Linking SDK for Android apps powered by Branch Metrics. We help mobile apps grow with deep links / deeplinks that power referral systems, sharing links and invites with full attribution and analytics.","fork":false,"url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking","forks_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/forks","keys_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/teams","hooks_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/hooks","issue_events_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/events{/number}","events_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/events","assignees_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/assignees{/user}","branches_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/branches{/branch}","tags_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/tags","blobs_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/refs{/sha}","trees_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/statuses/{sha}","languages_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/languages","stargazers_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/stargazers","contributors_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/contributors","subscribers_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/subscribers","subscription_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/subscription","commits_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/commits{/sha}","git_commits_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/git/commits{/sha}","comments_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/comments{/number}","issue_comment_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/comments{/number}","contents_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/contents/{+path}","compare_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/merges","archive_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/downloads","issues_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues{/number}","pulls_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls{/number}","milestones_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/milestones{/number}","notifications_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/labels{/name}","releases_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/releases{/id}","deployments_url":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/deployments","created_at":"2014-06-02T22:17:59Z","updated_at":"2016-06-10T19:00:18Z","pushed_at":"2016-06-14T18:37:39Z","git_url":"git://github.com/BranchMetrics/android-branch-deep-linking.git","ssh_url":"git@github.com:BranchMetrics/android-branch-deep-linking.git","clone_url":"https://github.com/BranchMetrics/android-branch-deep-linking.git","svn_url":"https://github.com/BranchMetrics/android-branch-deep-linking","homepage":"https://dev.branch.io/references/android_sdk/","size":15354,"stargazers_count":72,"watchers_count":72,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":6,"forks":47,"open_issues":6,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255"},"html":{"href":"https://github.com/BranchMetrics/android-branch-deep-linking/pull/255"},"issue":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/255"},"comments":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/issues/255/comments"},"review_comments":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255/comments"},"review_comment":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/pulls/255/commits"},"statuses":{"href":"https://api.github.com/repos/BranchMetrics/android-branch-deep-linking/statuses/f392ca3eb94545ba38a3e277d14cc87c76d14c1d"}}}}
{"actor":{"display_login":"sojanpr"}}