{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/187464908","pull_request_review_id":119253588,"id":187464908,"diff_hunk":"@@ -419,6 +430,138 @@ def load_crls(path)\n     end\n   end\n \n+  # Ensures that the CA certificate is available for either generating or\n+  # validating the host's cert.\n+  # It will first check if the cert is present in memory (used for testing),\n+  # then check on disk, and finally try to download it.\n+  # @return true if the CA certificate was found, false otherwise\n+  def ensure_ca_certificate\n+    file_path = certificate_location(CA_NAME)\n+    if check_for_certificate_in_memory(CA_NAME)\n+      true\n+    elsif Puppet::FileSystem.exist?(file_path)\n+      load_certificate_bundle(Puppet::FileSystem.read(file_path))\n+      true\n+    else\n+      bundle = download_ca_certificate_bundle\n+      if bundle\n+        save_certificate_bundle(bundle)\n+        true\n+      else\n+        false\n+      end\n+    end\n+  end\n+\n+  # Creates an arry of SSL Certificate objects from a PEM-encoding string\n+  # of one or more certs.\n+  # @param [String] bundle_string PEM-encoded string of certs\n+  # @return [[OpenSSL::X509::Certificate]] the certs loaded from the input string\n+  def load_certificate_bundle(bundle_string)","path":"lib/puppet/ssl/host.rb","position":67,"original_position":67,"commit_id":"7b2197380a927d229b739a0ea032cfe97e35dad8","original_commit_id":"7b2197380a927d229b739a0ea032cfe97e35dad8","user":{"login":"tvpartytonight","id":5789610,"avatar_url":"https://avatars0.githubusercontent.com/u/5789610?v=4","gravatar_id":"","url":"https://api.github.com/users/tvpartytonight","html_url":"https://github.com/tvpartytonight","followers_url":"https://api.github.com/users/tvpartytonight/followers","following_url":"https://api.github.com/users/tvpartytonight/following{/other_user}","gists_url":"https://api.github.com/users/tvpartytonight/gists{/gist_id}","starred_url":"https://api.github.com/users/tvpartytonight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvpartytonight/subscriptions","organizations_url":"https://api.github.com/users/tvpartytonight/orgs","repos_url":"https://api.github.com/users/tvpartytonight/repos","events_url":"https://api.github.com/users/tvpartytonight/events{/privacy}","received_events_url":"https://api.github.com/users/tvpartytonight/received_events","type":"User","site_admin":false},"body":"One thing I noticed about this method of getting an array of certs—which is essentially duped [here](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/ssl/validator/default_validator.rb#L127-L137)—is that it will remove any comments that are served. Maybe we don't care, but I did get rid of some artifacts that we had for testing [here](https://github.com/puppetlabs/puppet/pull/6806/files#diff-36ba91bafadfe988c92ed0a8438779b6L99), so it might something to make sure we don't care about?","created_at":"2018-05-10T21:25:30Z","updated_at":"2018-05-10T21:25:30Z","html_url":"https://github.com/puppetlabs/puppet/pull/6824#discussion_r187464908","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/187464908"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/6824#discussion_r187464908"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824","id":186786681,"html_url":"https://github.com/puppetlabs/puppet/pull/6824","diff_url":"https://github.com/puppetlabs/puppet/pull/6824.diff","patch_url":"https://github.com/puppetlabs/puppet/pull/6824.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet/issues/6824","number":6824,"state":"open","locked":false,"title":"(PUP-8653) Use new REST client to download certificates","user":{"login":"Magisus","id":839145,"avatar_url":"https://avatars3.githubusercontent.com/u/839145?v=4","gravatar_id":"","url":"https://api.github.com/users/Magisus","html_url":"https://github.com/Magisus","followers_url":"https://api.github.com/users/Magisus/followers","following_url":"https://api.github.com/users/Magisus/following{/other_user}","gists_url":"https://api.github.com/users/Magisus/gists{/gist_id}","starred_url":"https://api.github.com/users/Magisus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Magisus/subscriptions","organizations_url":"https://api.github.com/users/Magisus/orgs","repos_url":"https://api.github.com/users/Magisus/repos","events_url":"https://api.github.com/users/Magisus/events{/privacy}","received_events_url":"https://api.github.com/users/Magisus/received_events","type":"User","site_admin":false},"body":"This commit updates the SSL::Host class to use the new REST client to\r\ndownload certificates, instead of going through the indirector. It also\r\nupdates logic for saving certs.","created_at":"2018-05-09T00:05:22Z","updated_at":"2018-05-10T21:25:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6b124cbb8fb30fe0c1563f128f054c050b38a2f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/issues/6824/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/7b2197380a927d229b739a0ea032cfe97e35dad8","head":{"label":"Magisus:use-http-client","ref":"use-http-client","sha":"7b2197380a927d229b739a0ea032cfe97e35dad8","user":{"login":"Magisus","id":839145,"avatar_url":"https://avatars3.githubusercontent.com/u/839145?v=4","gravatar_id":"","url":"https://api.github.com/users/Magisus","html_url":"https://github.com/Magisus","followers_url":"https://api.github.com/users/Magisus/followers","following_url":"https://api.github.com/users/Magisus/following{/other_user}","gists_url":"https://api.github.com/users/Magisus/gists{/gist_id}","starred_url":"https://api.github.com/users/Magisus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Magisus/subscriptions","organizations_url":"https://api.github.com/users/Magisus/orgs","repos_url":"https://api.github.com/users/Magisus/repos","events_url":"https://api.github.com/users/Magisus/events{/privacy}","received_events_url":"https://api.github.com/users/Magisus/received_events","type":"User","site_admin":false},"repo":{"id":60648761,"name":"puppet","full_name":"Magisus/puppet","owner":{"login":"Magisus","id":839145,"avatar_url":"https://avatars3.githubusercontent.com/u/839145?v=4","gravatar_id":"","url":"https://api.github.com/users/Magisus","html_url":"https://github.com/Magisus","followers_url":"https://api.github.com/users/Magisus/followers","following_url":"https://api.github.com/users/Magisus/following{/other_user}","gists_url":"https://api.github.com/users/Magisus/gists{/gist_id}","starred_url":"https://api.github.com/users/Magisus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Magisus/subscriptions","organizations_url":"https://api.github.com/users/Magisus/orgs","repos_url":"https://api.github.com/users/Magisus/repos","events_url":"https://api.github.com/users/Magisus/events{/privacy}","received_events_url":"https://api.github.com/users/Magisus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Magisus/puppet","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/Magisus/puppet","forks_url":"https://api.github.com/repos/Magisus/puppet/forks","keys_url":"https://api.github.com/repos/Magisus/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Magisus/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Magisus/puppet/teams","hooks_url":"https://api.github.com/repos/Magisus/puppet/hooks","issue_events_url":"https://api.github.com/repos/Magisus/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/Magisus/puppet/events","assignees_url":"https://api.github.com/repos/Magisus/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/Magisus/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/Magisus/puppet/tags","blobs_url":"https://api.github.com/repos/Magisus/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Magisus/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Magisus/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Magisus/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Magisus/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/Magisus/puppet/languages","stargazers_url":"https://api.github.com/repos/Magisus/puppet/stargazers","contributors_url":"https://api.github.com/repos/Magisus/puppet/contributors","subscribers_url":"https://api.github.com/repos/Magisus/puppet/subscribers","subscription_url":"https://api.github.com/repos/Magisus/puppet/subscription","commits_url":"https://api.github.com/repos/Magisus/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Magisus/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Magisus/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Magisus/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Magisus/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/Magisus/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Magisus/puppet/merges","archive_url":"https://api.github.com/repos/Magisus/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Magisus/puppet/downloads","issues_url":"https://api.github.com/repos/Magisus/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/Magisus/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/Magisus/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/Magisus/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Magisus/puppet/labels{/name}","releases_url":"https://api.github.com/repos/Magisus/puppet/releases{/id}","deployments_url":"https://api.github.com/repos/Magisus/puppet/deployments","created_at":"2016-06-07T21:47:58Z","updated_at":"2018-05-09T21:44:21Z","pushed_at":"2018-05-09T22:39:10Z","git_url":"git://github.com/Magisus/puppet.git","ssh_url":"git@github.com:Magisus/puppet.git","clone_url":"https://github.com/Magisus/puppet.git","svn_url":"https://github.com/Magisus/puppet","homepage":"https://puppet.com/puppet/what-is-puppet","size":65151,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"c99148fc86bfb7da15947e9f70aab2a3b55f941b","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910744,"name":"puppet","full_name":"puppetlabs/puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet","forks_url":"https://api.github.com/repos/puppetlabs/puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/puppet/deployments","created_at":"2010-09-14T19:26:44Z","updated_at":"2018-05-10T20:19:47Z","pushed_at":"2018-05-10T20:19:39Z","git_url":"git://github.com/puppetlabs/puppet.git","ssh_url":"git@github.com:puppetlabs/puppet.git","clone_url":"https://github.com/puppetlabs/puppet.git","svn_url":"https://github.com/puppetlabs/puppet","homepage":"https://puppet.com/puppet/what-is-puppet","size":64892,"stargazers_count":4988,"watchers_count":4988,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2006,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2006,"open_issues":43,"watchers":4988,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/6824"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/6824"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/6824/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6824/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet/statuses/7b2197380a927d229b739a0ea032cfe97e35dad8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tvpartytonight"}}