{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/comments/36207649","id":36207649,"diff_hunk":"@@ -235,6 +239,58 @@ func (t *Target) Update(cfg *config.ScrapeConfig, baseLabels, metaLabels clientm\n \tt.metricRelabelConfigs = cfg.MetricRelabelConfigs\n }\n \n+func newHTTPClient(cfg *config.ScrapeConfig) *http.Client {\n+\ttlsConfig := &tls.Config{}\n+\n+\t// If a CA cert is provided then let's read it in so we can validate the\n+\t// scrape target's certificate properly.\n+\tif len(cfg.CACert) > 0 {\n+\t\tcaCertPool := x509.NewCertPool()\n+\t\t// Load CA cert.\n+\t\tcaCert, err := ioutil.ReadFile(cfg.CACert)\n+\t\tif err != nil {\n+\t\t\tlog.Errorf(\"Unable to use specified CA cert %s: %s\", cfg.CACert, err)","path":"retrieval/target.go","position":36,"original_position":36,"commit_id":"d65b162b1bf2e2191feec3e97450e2a457f66f2e","original_commit_id":"d65b162b1bf2e2191feec3e97450e2a457f66f2e","user":{"login":"fabxc","id":4948210,"avatar_url":"https://avatars.githubusercontent.com/u/4948210?v=3","gravatar_id":"","url":"https://api.github.com/users/fabxc","html_url":"https://github.com/fabxc","followers_url":"https://api.github.com/users/fabxc/followers","following_url":"https://api.github.com/users/fabxc/following{/other_user}","gists_url":"https://api.github.com/users/fabxc/gists{/gist_id}","starred_url":"https://api.github.com/users/fabxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabxc/subscriptions","organizations_url":"https://api.github.com/users/fabxc/orgs","repos_url":"https://api.github.com/users/fabxc/repos","events_url":"https://api.github.com/users/fabxc/events{/privacy}","received_events_url":"https://api.github.com/users/fabxc/received_events","type":"User","site_admin":false},"body":"No just return basically. As we can reload configs at runtime we absolutely don't want to crash when a config changes in a bad way.\r\n\r\nThinking about that, we should verify the existence of the cert files via `promtool check-config` – not in this PR though.","created_at":"2015-08-04T16:13:44Z","updated_at":"2015-08-04T16:13:44Z","html_url":"https://github.com/prometheus/prometheus/pull/921#discussion_r36207649","pull_request_url":"https://api.github.com/repos/prometheus/prometheus/pulls/921","_links":{"self":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/comments/36207649"},"html":{"href":"https://github.com/prometheus/prometheus/pull/921#discussion_r36207649"},"pull_request":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/921"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/921","id":40580069,"html_url":"https://github.com/prometheus/prometheus/pull/921","diff_url":"https://github.com/prometheus/prometheus/pull/921.diff","patch_url":"https://github.com/prometheus/prometheus/pull/921.patch","issue_url":"https://api.github.com/repos/prometheus/prometheus/issues/921","number":921,"state":"open","locked":false,"title":"Configuration options for bearer tokens, client certs & CA certs","user":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-07-22T15:49:06Z","updated_at":"2015-08-04T16:13:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29976604400b72408c9f4fbfec9e02ea06e124e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/prometheus/pulls/921/commits","review_comments_url":"https://api.github.com/repos/prometheus/prometheus/pulls/921/comments","review_comment_url":"https://api.github.com/repos/prometheus/prometheus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/921/comments","statuses_url":"https://api.github.com/repos/prometheus/prometheus/statuses/d65b162b1bf2e2191feec3e97450e2a457f66f2e","head":{"label":"jimmidyson:target-auth-options","ref":"target-auth-options","sha":"d65b162b1bf2e2191feec3e97450e2a457f66f2e","user":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"repo":{"id":39276484,"name":"prometheus","full_name":"jimmidyson/prometheus","owner":{"login":"jimmidyson","id":464659,"avatar_url":"https://avatars.githubusercontent.com/u/464659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimmidyson","html_url":"https://github.com/jimmidyson","followers_url":"https://api.github.com/users/jimmidyson/followers","following_url":"https://api.github.com/users/jimmidyson/following{/other_user}","gists_url":"https://api.github.com/users/jimmidyson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimmidyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimmidyson/subscriptions","organizations_url":"https://api.github.com/users/jimmidyson/orgs","repos_url":"https://api.github.com/users/jimmidyson/repos","events_url":"https://api.github.com/users/jimmidyson/events{/privacy}","received_events_url":"https://api.github.com/users/jimmidyson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimmidyson/prometheus","description":"The Prometheus monitoring system and time series database.","fork":true,"url":"https://api.github.com/repos/jimmidyson/prometheus","forks_url":"https://api.github.com/repos/jimmidyson/prometheus/forks","keys_url":"https://api.github.com/repos/jimmidyson/prometheus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimmidyson/prometheus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimmidyson/prometheus/teams","hooks_url":"https://api.github.com/repos/jimmidyson/prometheus/hooks","issue_events_url":"https://api.github.com/repos/jimmidyson/prometheus/issues/events{/number}","events_url":"https://api.github.com/repos/jimmidyson/prometheus/events","assignees_url":"https://api.github.com/repos/jimmidyson/prometheus/assignees{/user}","branches_url":"https://api.github.com/repos/jimmidyson/prometheus/branches{/branch}","tags_url":"https://api.github.com/repos/jimmidyson/prometheus/tags","blobs_url":"https://api.github.com/repos/jimmidyson/prometheus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimmidyson/prometheus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimmidyson/prometheus/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimmidyson/prometheus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimmidyson/prometheus/statuses/{sha}","languages_url":"https://api.github.com/repos/jimmidyson/prometheus/languages","stargazers_url":"https://api.github.com/repos/jimmidyson/prometheus/stargazers","contributors_url":"https://api.github.com/repos/jimmidyson/prometheus/contributors","subscribers_url":"https://api.github.com/repos/jimmidyson/prometheus/subscribers","subscription_url":"https://api.github.com/repos/jimmidyson/prometheus/subscription","commits_url":"https://api.github.com/repos/jimmidyson/prometheus/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimmidyson/prometheus/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimmidyson/prometheus/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimmidyson/prometheus/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimmidyson/prometheus/contents/{+path}","compare_url":"https://api.github.com/repos/jimmidyson/prometheus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimmidyson/prometheus/merges","archive_url":"https://api.github.com/repos/jimmidyson/prometheus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimmidyson/prometheus/downloads","issues_url":"https://api.github.com/repos/jimmidyson/prometheus/issues{/number}","pulls_url":"https://api.github.com/repos/jimmidyson/prometheus/pulls{/number}","milestones_url":"https://api.github.com/repos/jimmidyson/prometheus/milestones{/number}","notifications_url":"https://api.github.com/repos/jimmidyson/prometheus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimmidyson/prometheus/labels{/name}","releases_url":"https://api.github.com/repos/jimmidyson/prometheus/releases{/id}","created_at":"2015-07-17T21:40:55Z","updated_at":"2015-07-17T21:40:56Z","pushed_at":"2015-08-04T14:42:26Z","git_url":"git://github.com/jimmidyson/prometheus.git","ssh_url":"git@github.com:jimmidyson/prometheus.git","clone_url":"https://github.com/jimmidyson/prometheus.git","svn_url":"https://github.com/jimmidyson/prometheus","homepage":"http://prometheus.io/","size":9126,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"c322422412447a6f190dd013aa2b78a70e5a69e3","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":6838921,"name":"prometheus","full_name":"prometheus/prometheus","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/prometheus","description":"The Prometheus monitoring system and time series database.","fork":false,"url":"https://api.github.com/repos/prometheus/prometheus","forks_url":"https://api.github.com/repos/prometheus/prometheus/forks","keys_url":"https://api.github.com/repos/prometheus/prometheus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/prometheus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/prometheus/teams","hooks_url":"https://api.github.com/repos/prometheus/prometheus/hooks","issue_events_url":"https://api.github.com/repos/prometheus/prometheus/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/prometheus/events","assignees_url":"https://api.github.com/repos/prometheus/prometheus/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/prometheus/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/prometheus/tags","blobs_url":"https://api.github.com/repos/prometheus/prometheus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/prometheus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/prometheus/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/prometheus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/prometheus/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/prometheus/languages","stargazers_url":"https://api.github.com/repos/prometheus/prometheus/stargazers","contributors_url":"https://api.github.com/repos/prometheus/prometheus/contributors","subscribers_url":"https://api.github.com/repos/prometheus/prometheus/subscribers","subscription_url":"https://api.github.com/repos/prometheus/prometheus/subscription","commits_url":"https://api.github.com/repos/prometheus/prometheus/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/prometheus/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/prometheus/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/prometheus/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/prometheus/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/prometheus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/prometheus/merges","archive_url":"https://api.github.com/repos/prometheus/prometheus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/prometheus/downloads","issues_url":"https://api.github.com/repos/prometheus/prometheus/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/prometheus/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/prometheus/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/prometheus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/prometheus/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/prometheus/releases{/id}","created_at":"2012-11-24T11:14:12Z","updated_at":"2015-08-04T13:03:59Z","pushed_at":"2015-08-04T14:44:36Z","git_url":"git://github.com/prometheus/prometheus.git","ssh_url":"git@github.com:prometheus/prometheus.git","clone_url":"https://github.com/prometheus/prometheus.git","svn_url":"https://github.com/prometheus/prometheus","homepage":"http://prometheus.io/","size":19304,"stargazers_count":2673,"watchers_count":2673,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":165,"mirror_url":null,"open_issues_count":99,"forks":165,"open_issues":99,"watchers":2673,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/921"},"html":{"href":"https://github.com/prometheus/prometheus/pull/921"},"issue":{"href":"https://api.github.com/repos/prometheus/prometheus/issues/921"},"comments":{"href":"https://api.github.com/repos/prometheus/prometheus/issues/921/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/921/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/921/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/prometheus/statuses/d65b162b1bf2e2191feec3e97450e2a457f66f2e"}}}}