{"action":"created","comment":{"url":"https://api.github.com/repos/WinRb/WinRM/pulls/comments/41174118","id":41174118,"diff_hunk":"@@ -67,6 +73,22 @@ def no_ssl_peer_verification!\n         @httpcli.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE\n       end\n \n+      # SSL Peer Fingerprint Verification\n+      def ssl_peer_fingerprint_verification!\n+        noverify_peer_context = OpenSSL::SSL::SSLContext.new\n+        noverify_peer_context.verify_mode = OpenSSL::SSL::VERIFY_NONE\n+        tcp_connection = TCPSocket.new(@endpoint.host, @endpoint.port)\n+        shady_ssl_connection = OpenSSL::SSL::SSLSocket.new(tcp_connection,\n+                                                           noverify_peer_context)\n+        shady_ssl_connection.connect\n+        connection_cert = shady_ssl_connection.peer_cert_chain.last\n+        conn_fingerprint=OpenSSL::Digest::SHA1.new(connection_cert.to_der).to_s.upcase\n+        if @ssl_peer_fingerprint == conn_fingerprint\n+          @logger.info(\"ssl fingerprint #{@ssl_peer_fingerprint} verified\\n\")\n+          no_ssl_peer_verification!","path":"lib/winrm/http/transport.rb","position":29,"original_position":29,"commit_id":"7859a7cc48c75fd55dc9e3266202a490758a76fb","original_commit_id":"7859a7cc48c75fd55dc9e3266202a490758a76fb","user":{"login":"hh","id":31331,"avatar_url":"https://avatars.githubusercontent.com/u/31331?v=3","gravatar_id":"","url":"https://api.github.com/users/hh","html_url":"https://github.com/hh","followers_url":"https://api.github.com/users/hh/followers","following_url":"https://api.github.com/users/hh/following{/other_user}","gists_url":"https://api.github.com/users/hh/gists{/gist_id}","starred_url":"https://api.github.com/users/hh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hh/subscriptions","organizations_url":"https://api.github.com/users/hh/orgs","repos_url":"https://api.github.com/users/hh/repos","events_url":"https://api.github.com/users/hh/events{/privacy}","received_events_url":"https://api.github.com/users/hh/received_events","type":"User","site_admin":false},"body":"Do note that we have to turn off ssl_peer_verification for this to work.","created_at":"2015-10-05T17:46:46Z","updated_at":"2015-10-05T17:46:46Z","html_url":"https://github.com/WinRb/WinRM/pull/150#discussion_r41174118","pull_request_url":"https://api.github.com/repos/WinRb/WinRM/pulls/150","_links":{"self":{"href":"https://api.github.com/repos/WinRb/WinRM/pulls/comments/41174118"},"html":{"href":"https://github.com/WinRb/WinRM/pull/150#discussion_r41174118"},"pull_request":{"href":"https://api.github.com/repos/WinRb/WinRM/pulls/150"}}},"pull_request":{"url":"https://api.github.com/repos/WinRb/WinRM/pulls/150","id":46704602,"html_url":"https://github.com/WinRb/WinRM/pull/150","diff_url":"https://github.com/WinRb/WinRM/pull/150.diff","patch_url":"https://github.com/WinRb/WinRM/pull/150.patch","issue_url":"https://api.github.com/repos/WinRb/WinRM/issues/150","number":150,"state":"open","locked":false,"title":"notes around a possible lazy approach to self-signed verification","user":{"login":"hh","id":31331,"avatar_url":"https://avatars.githubusercontent.com/u/31331?v=3","gravatar_id":"","url":"https://api.github.com/users/hh","html_url":"https://github.com/hh","followers_url":"https://api.github.com/users/hh/followers","following_url":"https://api.github.com/users/hh/following{/other_user}","gists_url":"https://api.github.com/users/hh/gists{/gist_id}","starred_url":"https://api.github.com/users/hh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hh/subscriptions","organizations_url":"https://api.github.com/users/hh/orgs","repos_url":"https://api.github.com/users/hh/repos","events_url":"https://api.github.com/users/hh/events{/privacy}","received_events_url":"https://api.github.com/users/hh/received_events","type":"User","site_admin":false},"body":"This pull request is mainly to discuss approaches to ssl fingerprint or certificate checking when self-signed cert Common Names do not match the FDQN or IP of the host we are connecting to.","created_at":"2015-10-03T12:08:54Z","updated_at":"2015-10-05T17:46:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"041ae9b1754b4b10845aac77b353784710f0e9dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WinRb/WinRM/pulls/150/commits","review_comments_url":"https://api.github.com/repos/WinRb/WinRM/pulls/150/comments","review_comment_url":"https://api.github.com/repos/WinRb/WinRM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WinRb/WinRM/issues/150/comments","statuses_url":"https://api.github.com/repos/WinRb/WinRM/statuses/7859a7cc48c75fd55dc9e3266202a490758a76fb","head":{"label":"ii:ssl_self_signed_verify","ref":"ssl_self_signed_verify","sha":"7859a7cc48c75fd55dc9e3266202a490758a76fb","user":{"login":"ii","id":30447,"avatar_url":"https://avatars.githubusercontent.com/u/30447?v=3","gravatar_id":"","url":"https://api.github.com/users/ii","html_url":"https://github.com/ii","followers_url":"https://api.github.com/users/ii/followers","following_url":"https://api.github.com/users/ii/following{/other_user}","gists_url":"https://api.github.com/users/ii/gists{/gist_id}","starred_url":"https://api.github.com/users/ii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ii/subscriptions","organizations_url":"https://api.github.com/users/ii/orgs","repos_url":"https://api.github.com/users/ii/repos","events_url":"https://api.github.com/users/ii/events{/privacy}","received_events_url":"https://api.github.com/users/ii/received_events","type":"Organization","site_admin":false},"repo":{"id":43596436,"name":"WinRM","full_name":"ii/WinRM","owner":{"login":"ii","id":30447,"avatar_url":"https://avatars.githubusercontent.com/u/30447?v=3","gravatar_id":"","url":"https://api.github.com/users/ii","html_url":"https://github.com/ii","followers_url":"https://api.github.com/users/ii/followers","following_url":"https://api.github.com/users/ii/following{/other_user}","gists_url":"https://api.github.com/users/ii/gists{/gist_id}","starred_url":"https://api.github.com/users/ii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ii/subscriptions","organizations_url":"https://api.github.com/users/ii/orgs","repos_url":"https://api.github.com/users/ii/repos","events_url":"https://api.github.com/users/ii/events{/privacy}","received_events_url":"https://api.github.com/users/ii/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ii/WinRM","description":"Ruby library for Windows Remote Management","fork":true,"url":"https://api.github.com/repos/ii/WinRM","forks_url":"https://api.github.com/repos/ii/WinRM/forks","keys_url":"https://api.github.com/repos/ii/WinRM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ii/WinRM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ii/WinRM/teams","hooks_url":"https://api.github.com/repos/ii/WinRM/hooks","issue_events_url":"https://api.github.com/repos/ii/WinRM/issues/events{/number}","events_url":"https://api.github.com/repos/ii/WinRM/events","assignees_url":"https://api.github.com/repos/ii/WinRM/assignees{/user}","branches_url":"https://api.github.com/repos/ii/WinRM/branches{/branch}","tags_url":"https://api.github.com/repos/ii/WinRM/tags","blobs_url":"https://api.github.com/repos/ii/WinRM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ii/WinRM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ii/WinRM/git/refs{/sha}","trees_url":"https://api.github.com/repos/ii/WinRM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ii/WinRM/statuses/{sha}","languages_url":"https://api.github.com/repos/ii/WinRM/languages","stargazers_url":"https://api.github.com/repos/ii/WinRM/stargazers","contributors_url":"https://api.github.com/repos/ii/WinRM/contributors","subscribers_url":"https://api.github.com/repos/ii/WinRM/subscribers","subscription_url":"https://api.github.com/repos/ii/WinRM/subscription","commits_url":"https://api.github.com/repos/ii/WinRM/commits{/sha}","git_commits_url":"https://api.github.com/repos/ii/WinRM/git/commits{/sha}","comments_url":"https://api.github.com/repos/ii/WinRM/comments{/number}","issue_comment_url":"https://api.github.com/repos/ii/WinRM/issues/comments{/number}","contents_url":"https://api.github.com/repos/ii/WinRM/contents/{+path}","compare_url":"https://api.github.com/repos/ii/WinRM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ii/WinRM/merges","archive_url":"https://api.github.com/repos/ii/WinRM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ii/WinRM/downloads","issues_url":"https://api.github.com/repos/ii/WinRM/issues{/number}","pulls_url":"https://api.github.com/repos/ii/WinRM/pulls{/number}","milestones_url":"https://api.github.com/repos/ii/WinRM/milestones{/number}","notifications_url":"https://api.github.com/repos/ii/WinRM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ii/WinRM/labels{/name}","releases_url":"https://api.github.com/repos/ii/WinRM/releases{/id}","created_at":"2015-10-03T11:08:25Z","updated_at":"2015-10-03T11:08:28Z","pushed_at":"2015-10-05T17:45:41Z","git_url":"git://github.com/ii/WinRM.git","ssh_url":"git@github.com:ii/WinRM.git","clone_url":"https://github.com/ii/WinRM.git","svn_url":"https://github.com/ii/WinRM","homepage":"","size":1196,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"WinRb:master","ref":"master","sha":"6059c364f4a5c4c3d82616b7b2c9dcad178d862f","user":{"login":"WinRb","id":3925040,"avatar_url":"https://avatars.githubusercontent.com/u/3925040?v=3","gravatar_id":"","url":"https://api.github.com/users/WinRb","html_url":"https://github.com/WinRb","followers_url":"https://api.github.com/users/WinRb/followers","following_url":"https://api.github.com/users/WinRb/following{/other_user}","gists_url":"https://api.github.com/users/WinRb/gists{/gist_id}","starred_url":"https://api.github.com/users/WinRb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WinRb/subscriptions","organizations_url":"https://api.github.com/users/WinRb/orgs","repos_url":"https://api.github.com/users/WinRb/repos","events_url":"https://api.github.com/users/WinRb/events{/privacy}","received_events_url":"https://api.github.com/users/WinRb/received_events","type":"Organization","site_admin":false},"repo":{"id":844729,"name":"WinRM","full_name":"WinRb/WinRM","owner":{"login":"WinRb","id":3925040,"avatar_url":"https://avatars.githubusercontent.com/u/3925040?v=3","gravatar_id":"","url":"https://api.github.com/users/WinRb","html_url":"https://github.com/WinRb","followers_url":"https://api.github.com/users/WinRb/followers","following_url":"https://api.github.com/users/WinRb/following{/other_user}","gists_url":"https://api.github.com/users/WinRb/gists{/gist_id}","starred_url":"https://api.github.com/users/WinRb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WinRb/subscriptions","organizations_url":"https://api.github.com/users/WinRb/orgs","repos_url":"https://api.github.com/users/WinRb/repos","events_url":"https://api.github.com/users/WinRb/events{/privacy}","received_events_url":"https://api.github.com/users/WinRb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WinRb/WinRM","description":"Ruby library for Windows Remote Management","fork":false,"url":"https://api.github.com/repos/WinRb/WinRM","forks_url":"https://api.github.com/repos/WinRb/WinRM/forks","keys_url":"https://api.github.com/repos/WinRb/WinRM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WinRb/WinRM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WinRb/WinRM/teams","hooks_url":"https://api.github.com/repos/WinRb/WinRM/hooks","issue_events_url":"https://api.github.com/repos/WinRb/WinRM/issues/events{/number}","events_url":"https://api.github.com/repos/WinRb/WinRM/events","assignees_url":"https://api.github.com/repos/WinRb/WinRM/assignees{/user}","branches_url":"https://api.github.com/repos/WinRb/WinRM/branches{/branch}","tags_url":"https://api.github.com/repos/WinRb/WinRM/tags","blobs_url":"https://api.github.com/repos/WinRb/WinRM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WinRb/WinRM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WinRb/WinRM/git/refs{/sha}","trees_url":"https://api.github.com/repos/WinRb/WinRM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WinRb/WinRM/statuses/{sha}","languages_url":"https://api.github.com/repos/WinRb/WinRM/languages","stargazers_url":"https://api.github.com/repos/WinRb/WinRM/stargazers","contributors_url":"https://api.github.com/repos/WinRb/WinRM/contributors","subscribers_url":"https://api.github.com/repos/WinRb/WinRM/subscribers","subscription_url":"https://api.github.com/repos/WinRb/WinRM/subscription","commits_url":"https://api.github.com/repos/WinRb/WinRM/commits{/sha}","git_commits_url":"https://api.github.com/repos/WinRb/WinRM/git/commits{/sha}","comments_url":"https://api.github.com/repos/WinRb/WinRM/comments{/number}","issue_comment_url":"https://api.github.com/repos/WinRb/WinRM/issues/comments{/number}","contents_url":"https://api.github.com/repos/WinRb/WinRM/contents/{+path}","compare_url":"https://api.github.com/repos/WinRb/WinRM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WinRb/WinRM/merges","archive_url":"https://api.github.com/repos/WinRb/WinRM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WinRb/WinRM/downloads","issues_url":"https://api.github.com/repos/WinRb/WinRM/issues{/number}","pulls_url":"https://api.github.com/repos/WinRb/WinRM/pulls{/number}","milestones_url":"https://api.github.com/repos/WinRb/WinRM/milestones{/number}","notifications_url":"https://api.github.com/repos/WinRb/WinRM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WinRb/WinRM/labels{/name}","releases_url":"https://api.github.com/repos/WinRb/WinRM/releases{/id}","created_at":"2010-08-17T20:56:21Z","updated_at":"2015-10-05T08:41:10Z","pushed_at":"2015-10-05T17:45:41Z","git_url":"git://github.com/WinRb/WinRM.git","ssh_url":"git@github.com:WinRb/WinRM.git","clone_url":"https://github.com/WinRb/WinRM.git","svn_url":"https://github.com/WinRb/WinRM","homepage":"","size":1196,"stargazers_count":233,"watchers_count":233,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":14,"forks":80,"open_issues":14,"watchers":233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WinRb/WinRM/pulls/150"},"html":{"href":"https://github.com/WinRb/WinRM/pull/150"},"issue":{"href":"https://api.github.com/repos/WinRb/WinRM/issues/150"},"comments":{"href":"https://api.github.com/repos/WinRb/WinRM/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/WinRb/WinRM/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/WinRb/WinRM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WinRb/WinRM/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/WinRb/WinRM/statuses/7859a7cc48c75fd55dc9e3266202a490758a76fb"}}}}