{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/63487178","id":63487178,"diff_hunk":"@@ -4849,32 +4846,72 @@ public static function permit_ssl( $force_recheck = false ) {\n \n \t\t\t\t// If it's not 'NEVER', test to see\n \t\t\t\tif ( $ssl ) {\n-\t\t\t\t\t$response = wp_remote_get( JETPACK__API_BASE . 'test/1/' );\n-\t\t\t\t\tif ( is_wp_error( $response ) || ( 'OK' !== wp_remote_retrieve_body( $response ) ) ) {\n+\t\t\t\t\tif ( ! wp_http_supports( array( 'ssl' => true ) ) ) {\n \t\t\t\t\t\t$ssl = 0;\n+\t\t\t\t\t\t$message = __( 'WordPress reports no SSL support', 'jetpack' );\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\t$response = wp_remote_get( JETPACK__API_BASE . 'test/1/' );\n+\t\t\t\t\t\tif ( is_wp_error( $response ) ) {\n+\t\t\t\t\t\t\t$ssl = 0;\n+\t\t\t\t\t\t\t$message = __( 'WordPress reports no SSL support', 'jetpack' );\n+\t\t\t\t\t\t} elseif ( 'OK' !== wp_remote_retrieve_body( $response ) ) {\n+\t\t\t\t\t\t\t$ssl = 0;\n+\t\t\t\t\t\t\t$message = __( 'Response was not OK: ', 'jetpack' ) . wp_remote_retrieve_body( $response );\n+\t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tset_transient( 'jetpack_https_test', $ssl, DAY_IN_SECONDS );\n+\t\t\tset_transient( 'jetpack_https_test_message', $message, DAY_IN_SECONDS );\n \t\t}\n \n \t\treturn (bool) $ssl;\n \t}\n \n \t/*\n-\t * Displays an admin_notice, alerting the user to their JETPACK_CLIENT__HTTPS constant being 'ALWAYS' but SSL isn't working.\n+\t * Displays an admin_notice, alerting the user to their JETPACK_CLIENT__HTTPS constant being 'AUTO' but SSL isn't working.\n \t */\n-\tpublic function alert_required_ssl_fail() {\n+\tpublic function alert_auto_ssl_fail() {\n \t\tif ( ! current_user_can( 'manage_options' ) )\n \t\t\treturn;\n \t\t?>\n \n-\t\t<div id=\"message\" class=\"error jetpack-message jp-identity-crisis\">\n+\t\t<div id=\"jetpack-ssl-warning\" class=\"error jp-identity-crisis\">\n \t\t\t<div class=\"jp-banner__content\">\n-\t\t\t\t<h2><?php _e( 'Something is being cranky!', 'jetpack' ); ?></h2>\n-\t\t\t\t<p><?php _e( 'Your site is configured to only permit SSL connections to Jetpack, but SSL connections don\\'t seem to be functional!', 'jetpack' ); ?></p>\n+\t\t\t\t<h2><?php _e( 'Outbound HTTPS not working', 'jetpack' ); ?></h2>\n+\t\t\t\t<p><?php _e( 'Your site could not connect to WordPress.com via HTTPS. This could be due to any number of reasons, including faulty SSL certificates, misconfigured or missing SSL libraries, or network issues.', 'jetpack' ); ?></p>\n+\t\t\t\t<p>\n+\t\t\t\t\t<?php _e( 'Jetpack will re-test for HTTPS support once a day, but you can click here to try again immediately: ', 'jetpack' ); ?>\n+\t\t\t\t\t<a href=\"#\" id=\"jetpack-recheck-ssl-button\"><?php _e( 'Try again' ); ?></a>\n+\t\t\t\t\t<span id=\"jetpack-recheck-ssl-output\"><?php echo get_transient( 'jetpack_https_test_message' ); ?></span>\n+\t\t\t\t</p>\n+\t\t\t\t<p>\n+\t\t\t\t\t<?php _e( 'For more help, see our ', 'jetpack' ); ?><a href=\"https://jetpack.com/support/getting-started-with-jetpack/troubleshooting-tips/\"><?php _e( 'troubleshooting tips', 'jetpack' ); ?></a>","path":"class.jetpack.php","position":93,"original_position":93,"commit_id":"82e8d5a449bbb90efb8e70455828d15f144c79cd","original_commit_id":"82e8d5a449bbb90efb8e70455828d15f144c79cd","user":{"login":"jeherve","id":426388,"avatar_url":"https://avatars.githubusercontent.com/u/426388?v=3","gravatar_id":"","url":"https://api.github.com/users/jeherve","html_url":"https://github.com/jeherve","followers_url":"https://api.github.com/users/jeherve/followers","following_url":"https://api.github.com/users/jeherve/following{/other_user}","gists_url":"https://api.github.com/users/jeherve/gists{/gist_id}","starred_url":"https://api.github.com/users/jeherve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeherve/subscriptions","organizations_url":"https://api.github.com/users/jeherve/orgs","repos_url":"https://api.github.com/users/jeherve/repos","events_url":"https://api.github.com/users/jeherve/events{/privacy}","received_events_url":"https://api.github.com/users/jeherve/received_events","type":"User","site_admin":false},"body":"It might be better for translators if you were to use `printf` here, and only have one string to translate.","created_at":"2016-05-17T09:02:51Z","updated_at":"2016-05-17T09:02:52Z","html_url":"https://github.com/Automattic/jetpack/pull/3816#discussion_r63487178","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/3816","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/63487178"},"html":{"href":"https://github.com/Automattic/jetpack/pull/3816#discussion_r63487178"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/3816"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/3816","id":70301575,"html_url":"https://github.com/Automattic/jetpack/pull/3816","diff_url":"https://github.com/Automattic/jetpack/pull/3816.diff","patch_url":"https://github.com/Automattic/jetpack/pull/3816.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/3816","number":3816,"state":"open","locked":false,"title":"Don't fall back to HTTP connection if SSL fails","user":{"login":"gravityrail","id":51896,"avatar_url":"https://avatars.githubusercontent.com/u/51896?v=3","gravatar_id":"","url":"https://api.github.com/users/gravityrail","html_url":"https://github.com/gravityrail","followers_url":"https://api.github.com/users/gravityrail/followers","following_url":"https://api.github.com/users/gravityrail/following{/other_user}","gists_url":"https://api.github.com/users/gravityrail/gists{/gist_id}","starred_url":"https://api.github.com/users/gravityrail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravityrail/subscriptions","organizations_url":"https://api.github.com/users/gravityrail/orgs","repos_url":"https://api.github.com/users/gravityrail/repos","events_url":"https://api.github.com/users/gravityrail/events{/privacy}","received_events_url":"https://api.github.com/users/gravityrail/received_events","type":"User","site_admin":false},"body":"This change came out of thread p7rcWF-3B-p2, regarding SSL connections from WP sites to WordPress.com.\r\n\r\nThe basic idea is that we shouldn't silently fall back to HTTP if HTTPS isn't available - we should warn the user and let them override it with a constant in wp-config.php.\r\n\r\nThe functional change is very small - basically `Jetpack::fix_url_for_bad_hosts( $url )` now always returns the original URL passed in, UNLESS the constant `JETPACK_CLIENT__HTTPS` is set to `NEVER`.\r\n\r\nThis branch implements the UI change in a self-contained but possibly messy way, with style, JS and content all grouped together. Style suggestions welcome.\r\n\r\nIt also adds a REST API endpoint to check for SSL status, which is used by the JS.\r\n\r\nTo force a fake SSL error, just set the transients used to cache the result of the test:\r\n\r\n```bash\r\n$ wp shell\r\nwp> set_transient( 'jetpack_https_test', 0, DAY_IN_SECONDS )\r\nwp> set_transient( 'jetpack_https_test_message', 'Bad Things Happened', DAY_IN_SECONDS )\r\n```\r\n\r\nThen load any admin page and you should see a warning:\r\n\r\n<img width=\"865\" alt=\"big-fat-warning\" src=\"https://cloud.githubusercontent.com/assets/51896/15311856/eb2c7610-1bb3-11e6-8962-4a3252cea679.png\">\r\n\r\nClicking the \"Try again\" link (or waiting 24 hours) should make the warning go away. If there is an error trying again, it will be displayed in red next to the link.\r\n\r\nIt would be great if folks could test this on an actually-messed-up, no-HTTPS host. However, I'm fairly confident that it will work since it changes very little about the mechanisms used to detect SSL support.\r\n\r\ncc @lezama @kraftbj @mdawaffe @beaulebens ","created_at":"2016-05-17T05:26:57Z","updated_at":"2016-05-17T09:02:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0af3131b55466559a0e88bf061632a386ab861f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/3816/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/3816/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/3816/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/82e8d5a449bbb90efb8e70455828d15f144c79cd","head":{"label":"Automattic:add/warning-for-no-ssl","ref":"add/warning-for-no-ssl","sha":"82e8d5a449bbb90efb8e70455828d15f144c79cd","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2016-05-14T13:32:58Z","pushed_at":"2016-05-17T05:53:44Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"http://jetpack.com","size":278017,"stargazers_count":524,"watchers_count":524,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":320,"mirror_url":null,"open_issues_count":724,"forks":320,"open_issues":724,"watchers":524,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"bea064e2e2d60c295aa4ef6989ce536c31ee315a","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/jetpack/deployments","created_at":"2013-12-16T16:43:01Z","updated_at":"2016-05-14T13:32:58Z","pushed_at":"2016-05-17T05:53:44Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"http://jetpack.com","size":278017,"stargazers_count":524,"watchers_count":524,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":320,"mirror_url":null,"open_issues_count":724,"forks":320,"open_issues":724,"watchers":524,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/3816"},"html":{"href":"https://github.com/Automattic/jetpack/pull/3816"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/3816"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/3816/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/3816/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/3816/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/82e8d5a449bbb90efb8e70455828d15f144c79cd"}}}}