{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/48967797","id":48967797,"diff_hunk":"@@ -429,12 +430,23 @@ def _get_server_instance(self, instance):\n             'vcenter_host:{0}'.format(instance.get('host')),\n         ]\n \n+        ssl_verify = instance.get('ssl_verify', True)\n+        ssl_capath = instance.get('ssl_capath', None)\n+        if not ssl_verify:\n+            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n+            context.verify_mode = ssl.CERT_NONE\n+        elif ssl_capath:\n+            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n+            context.verify_mode = ssl.CERT_REQUIRED\n+            context.load_verify_locations(capath=ssl_capath)\n+\n         if i_key not in self.server_instances:\n             try:\n                 server_instance = connect.SmartConnect(\n-                    host=instance.get('host'),\n-                    user=instance.get('username'),\n-                    pwd=instance.get('password')\n+                    host = instance.get('host'),\n+                    user = instance.get('username'),\n+                    pwd = instance.get('password'),\n+                    sslContext = context if not ssl_verify or ssl_capath else None","path":"checks.d/vsphere.py","position":31,"original_position":31,"commit_id":"cd8fa6ef6669236e8753cde5b7de277f0aa43b32","original_commit_id":"cd8fa6ef6669236e8753cde5b7de277f0aa43b32","user":{"login":"truthbk","id":448216,"avatar_url":"https://avatars.githubusercontent.com/u/448216?v=3","gravatar_id":"","url":"https://api.github.com/users/truthbk","html_url":"https://github.com/truthbk","followers_url":"https://api.github.com/users/truthbk/followers","following_url":"https://api.github.com/users/truthbk/following{/other_user}","gists_url":"https://api.github.com/users/truthbk/gists{/gist_id}","starred_url":"https://api.github.com/users/truthbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truthbk/subscriptions","organizations_url":"https://api.github.com/users/truthbk/orgs","repos_url":"https://api.github.com/users/truthbk/repos","events_url":"https://api.github.com/users/truthbk/events{/privacy}","received_events_url":"https://api.github.com/users/truthbk/received_events","type":"User","site_admin":false},"body":"If the customer accidentally sets `ssl_verify` to False and also sets an `ssl_capath` in the config, the `not ssl_verify` context takes precedence (which I think makes sense) but we should probably log it somewhere to help identify that case come support-time.","created_at":"2016-01-06T15:24:14Z","updated_at":"2016-01-06T15:24:14Z","html_url":"https://github.com/DataDog/dd-agent/pull/2180#discussion_r48967797","pull_request_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/48967797"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/2180#discussion_r48967797"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180","id":55141331,"html_url":"https://github.com/DataDog/dd-agent/pull/2180","diff_url":"https://github.com/DataDog/dd-agent/pull/2180.diff","patch_url":"https://github.com/DataDog/dd-agent/pull/2180.patch","issue_url":"https://api.github.com/repos/DataDog/dd-agent/issues/2180","number":2180,"state":"open","locked":false,"title":"[vsphere] Add SSL config options for certs","user":{"login":"JohnLZeller","id":1171118,"avatar_url":"https://avatars.githubusercontent.com/u/1171118?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnLZeller","html_url":"https://github.com/JohnLZeller","followers_url":"https://api.github.com/users/JohnLZeller/followers","following_url":"https://api.github.com/users/JohnLZeller/following{/other_user}","gists_url":"https://api.github.com/users/JohnLZeller/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnLZeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnLZeller/subscriptions","organizations_url":"https://api.github.com/users/JohnLZeller/orgs","repos_url":"https://api.github.com/users/JohnLZeller/repos","events_url":"https://api.github.com/users/JohnLZeller/events{/privacy}","received_events_url":"https://api.github.com/users/JohnLZeller/received_events","type":"User","site_admin":false},"body":"As it stands, the vsphere check does not allow customization of SSL verification procedures in any way. This PR seeks to allow the ability to disable SSL verification, and to specify your own CA certificates.","created_at":"2016-01-05T20:51:57Z","updated_at":"2016-01-06T15:24:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"141acd0c2fea5983ca870f4d2dd7f11a06a3290e","assignee":{"login":"truthbk","id":448216,"avatar_url":"https://avatars.githubusercontent.com/u/448216?v=3","gravatar_id":"","url":"https://api.github.com/users/truthbk","html_url":"https://github.com/truthbk","followers_url":"https://api.github.com/users/truthbk/followers","following_url":"https://api.github.com/users/truthbk/following{/other_user}","gists_url":"https://api.github.com/users/truthbk/gists{/gist_id}","starred_url":"https://api.github.com/users/truthbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truthbk/subscriptions","organizations_url":"https://api.github.com/users/truthbk/orgs","repos_url":"https://api.github.com/users/truthbk/repos","events_url":"https://api.github.com/users/truthbk/events{/privacy}","received_events_url":"https://api.github.com/users/truthbk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180/comments","review_comment_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/issues/2180/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/cd8fa6ef6669236e8753cde5b7de277f0aa43b32","head":{"label":"DataDog:zeller/vsphere-ssl","ref":"zeller/vsphere-ssl","sha":"cd8fa6ef6669236e8753cde5b7de277f0aa43b32","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2016-01-04T03:39:18Z","pushed_at":"2016-01-06T14:19:28Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":32823,"stargazers_count":399,"watchers_count":399,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":366,"mirror_url":null,"open_issues_count":147,"forks":366,"open_issues":147,"watchers":399,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"de406812985887611caadc89d5f7a33232fd1958","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2016-01-04T03:39:18Z","pushed_at":"2016-01-06T14:19:28Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":32823,"stargazers_count":399,"watchers_count":399,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":366,"mirror_url":null,"open_issues_count":147,"forks":366,"open_issues":147,"watchers":399,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/2180"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/2180"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/2180/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2180/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-agent/statuses/cd8fa6ef6669236e8753cde5b7de277f0aa43b32"}}}}