{"action":"created","comment":{"url":"https://api.github.com/repos/cloudflare/cfssl/pulls/comments/25297439","id":25297439,"diff_hunk":"@@ -0,0 +1,111 @@\n+package scan\n+\n+import (\n+\t\"fmt\"\n+\t\"net\"\n+\t\"strings\"\n+\n+\t\"github.com/cloudflare/cf-tls/tls\"\n+)\n+\n+// TLSHandshake contains scanners testing host cipher suite negotiation\n+var TLSHandshake = &Family{\n+\tName:        \"TLSHandshake\",\n+\tDescription: \"Scans for host's SSL/TLS version and cipher suite negotiation\",\n+\tScanners: []*Scanner{\n+\t\t{\n+\t\t\t\"CipherSuite\",\n+\t\t\t\"Determines host's cipher suites accepted and prefered order\",\n+\t\t\tcipherSuiteScan,\n+\t\t},\n+\t},\n+}\n+\n+func sayHello(host string, ciphers []uint16, vers uint16) (cipherIndex int, err error) {\n+\ttcpConn, err := net.Dial(Network, host)\n+\tif err != nil {\n+\t\treturn\n+\t}\n+\tconn := tls.Client(tcpConn, &tls.Config{MinVersion: vers, MaxVersion: vers, ServerName: host, CipherSuites: ciphers, SessionTicketsDisabled: true, ClientSessionCache: nil})\n+\tserverCipher, serverVersion, err := conn.SayHello()\n+\tconn.Close()\n+\tif err != nil {\n+\t\treturn\n+\t}\n+\tif serverVersion != vers {\n+\t\terr = fmt.Errorf(\"server negotiated protocol version we didn't send: %s\", tls.Versions[serverVersion])\n+\t\treturn\n+\t}\n+\tvar cipherID uint16","path":"scan/tls_handshake.go","position":39,"original_position":39,"commit_id":"8f83278aaca0d0f94bf0c2cf7ae6e0f625204413","original_commit_id":"8f83278aaca0d0f94bf0c2cf7ae6e0f625204413","user":{"login":"kisom","id":175578,"avatar_url":"https://avatars.githubusercontent.com/u/175578?v=3","gravatar_id":"","url":"https://api.github.com/users/kisom","html_url":"https://github.com/kisom","followers_url":"https://api.github.com/users/kisom/followers","following_url":"https://api.github.com/users/kisom/following{/other_user}","gists_url":"https://api.github.com/users/kisom/gists{/gist_id}","starred_url":"https://api.github.com/users/kisom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kisom/subscriptions","organizations_url":"https://api.github.com/users/kisom/orgs","repos_url":"https://api.github.com/users/kisom/repos","events_url":"https://api.github.com/users/kisom/events{/privacy}","received_events_url":"https://api.github.com/users/kisom/received_events","type":"User","site_admin":false},"body":"and probably here, too.","created_at":"2015-02-24T22:01:57Z","updated_at":"2015-02-24T22:01:57Z","html_url":"https://github.com/cloudflare/cfssl/pull/73#discussion_r25297439","pull_request_url":"https://api.github.com/repos/cloudflare/cfssl/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/cloudflare/cfssl/pulls/comments/25297439"},"html":{"href":"https://github.com/cloudflare/cfssl/pull/73#discussion_r25297439"},"pull_request":{"href":"https://api.github.com/repos/cloudflare/cfssl/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/cloudflare/cfssl/pulls/73","id":27622315,"html_url":"https://github.com/cloudflare/cfssl/pull/73","diff_url":"https://github.com/cloudflare/cfssl/pull/73.diff","patch_url":"https://github.com/cloudflare/cfssl/pull/73.patch","issue_url":"https://api.github.com/repos/cloudflare/cfssl/issues/73","number":73,"state":"open","locked":false,"title":"Initial CLI Version of `cfssl scan`","user":{"login":"jacobhaven","id":95305,"avatar_url":"https://avatars.githubusercontent.com/u/95305?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobhaven","html_url":"https://github.com/jacobhaven","followers_url":"https://api.github.com/users/jacobhaven/followers","following_url":"https://api.github.com/users/jacobhaven/following{/other_user}","gists_url":"https://api.github.com/users/jacobhaven/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobhaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobhaven/subscriptions","organizations_url":"https://api.github.com/users/jacobhaven/orgs","repos_url":"https://api.github.com/users/jacobhaven/repos","events_url":"https://api.github.com/users/jacobhaven/events{/privacy}","received_events_url":"https://api.github.com/users/jacobhaven/received_events","type":"User","site_admin":false},"body":"Adds new `scan` command, that performs a variety of connectivity and TLS protocol tests.\r\n\r\nUnfortunately, some of these require importing the go standard library's `crypto/tls` package's source in order to access private members. These are used in `scan/tls/cfsslscan_*.go` files to export additional functionality not supplied by the `crypto/tls` API.\r\n\r\nSupport for the standard CFSSL HTTP API is forthcoming, but comments on this initial structure might be useful first.","created_at":"2015-01-19T17:20:10Z","updated_at":"2015-02-24T22:01:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"797dc9108298798a62023d71dc0e5732c1da320c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cloudflare/cfssl/pulls/73/commits","review_comments_url":"https://api.github.com/repos/cloudflare/cfssl/pulls/73/comments","review_comment_url":"https://api.github.com/repos/cloudflare/cfssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudflare/cfssl/issues/73/comments","statuses_url":"https://api.github.com/repos/cloudflare/cfssl/statuses/8f83278aaca0d0f94bf0c2cf7ae6e0f625204413","head":{"label":"cloudflare:jacob/scan","ref":"jacob/scan","sha":"8f83278aaca0d0f94bf0c2cf7ae6e0f625204413","user":{"login":"cloudflare","id":314135,"avatar_url":"https://avatars.githubusercontent.com/u/314135?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudflare","html_url":"https://github.com/cloudflare","followers_url":"https://api.github.com/users/cloudflare/followers","following_url":"https://api.github.com/users/cloudflare/following{/other_user}","gists_url":"https://api.github.com/users/cloudflare/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudflare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudflare/subscriptions","organizations_url":"https://api.github.com/users/cloudflare/orgs","repos_url":"https://api.github.com/users/cloudflare/repos","events_url":"https://api.github.com/users/cloudflare/events{/privacy}","received_events_url":"https://api.github.com/users/cloudflare/received_events","type":"Organization","site_admin":false},"repo":{"id":21591001,"name":"cfssl","full_name":"cloudflare/cfssl","owner":{"login":"cloudflare","id":314135,"avatar_url":"https://avatars.githubusercontent.com/u/314135?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudflare","html_url":"https://github.com/cloudflare","followers_url":"https://api.github.com/users/cloudflare/followers","following_url":"https://api.github.com/users/cloudflare/following{/other_user}","gists_url":"https://api.github.com/users/cloudflare/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudflare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudflare/subscriptions","organizations_url":"https://api.github.com/users/cloudflare/orgs","repos_url":"https://api.github.com/users/cloudflare/repos","events_url":"https://api.github.com/users/cloudflare/events{/privacy}","received_events_url":"https://api.github.com/users/cloudflare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudflare/cfssl","description":"CFSSL: CloudFlare's PKI toolkit","fork":false,"url":"https://api.github.com/repos/cloudflare/cfssl","forks_url":"https://api.github.com/repos/cloudflare/cfssl/forks","keys_url":"https://api.github.com/repos/cloudflare/cfssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudflare/cfssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudflare/cfssl/teams","hooks_url":"https://api.github.com/repos/cloudflare/cfssl/hooks","issue_events_url":"https://api.github.com/repos/cloudflare/cfssl/issues/events{/number}","events_url":"https://api.github.com/repos/cloudflare/cfssl/events","assignees_url":"https://api.github.com/repos/cloudflare/cfssl/assignees{/user}","branches_url":"https://api.github.com/repos/cloudflare/cfssl/branches{/branch}","tags_url":"https://api.github.com/repos/cloudflare/cfssl/tags","blobs_url":"https://api.github.com/repos/cloudflare/cfssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudflare/cfssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudflare/cfssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudflare/cfssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudflare/cfssl/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudflare/cfssl/languages","stargazers_url":"https://api.github.com/repos/cloudflare/cfssl/stargazers","contributors_url":"https://api.github.com/repos/cloudflare/cfssl/contributors","subscribers_url":"https://api.github.com/repos/cloudflare/cfssl/subscribers","subscription_url":"https://api.github.com/repos/cloudflare/cfssl/subscription","commits_url":"https://api.github.com/repos/cloudflare/cfssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudflare/cfssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudflare/cfssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudflare/cfssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudflare/cfssl/contents/{+path}","compare_url":"https://api.github.com/repos/cloudflare/cfssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudflare/cfssl/merges","archive_url":"https://api.github.com/repos/cloudflare/cfssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudflare/cfssl/downloads","issues_url":"https://api.github.com/repos/cloudflare/cfssl/issues{/number}","pulls_url":"https://api.github.com/repos/cloudflare/cfssl/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudflare/cfssl/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudflare/cfssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudflare/cfssl/labels{/name}","releases_url":"https://api.github.com/repos/cloudflare/cfssl/releases{/id}","created_at":"2014-07-07T23:49:12Z","updated_at":"2015-02-24T19:22:11Z","pushed_at":"2015-02-24T19:22:11Z","git_url":"git://github.com/cloudflare/cfssl.git","ssh_url":"git@github.com:cloudflare/cfssl.git","clone_url":"https://github.com/cloudflare/cfssl.git","svn_url":"https://github.com/cloudflare/cfssl","homepage":"https://blog.cloudflare.com/introducing-cfssl","size":4773,"stargazers_count":453,"watchers_count":453,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":18,"forks":33,"open_issues":18,"watchers":453,"default_branch":"master"}},"base":{"label":"cloudflare:master","ref":"master","sha":"55a735b51c216b71e87dda61b74e7770b476cfdb","user":{"login":"cloudflare","id":314135,"avatar_url":"https://avatars.githubusercontent.com/u/314135?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudflare","html_url":"https://github.com/cloudflare","followers_url":"https://api.github.com/users/cloudflare/followers","following_url":"https://api.github.com/users/cloudflare/following{/other_user}","gists_url":"https://api.github.com/users/cloudflare/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudflare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudflare/subscriptions","organizations_url":"https://api.github.com/users/cloudflare/orgs","repos_url":"https://api.github.com/users/cloudflare/repos","events_url":"https://api.github.com/users/cloudflare/events{/privacy}","received_events_url":"https://api.github.com/users/cloudflare/received_events","type":"Organization","site_admin":false},"repo":{"id":21591001,"name":"cfssl","full_name":"cloudflare/cfssl","owner":{"login":"cloudflare","id":314135,"avatar_url":"https://avatars.githubusercontent.com/u/314135?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudflare","html_url":"https://github.com/cloudflare","followers_url":"https://api.github.com/users/cloudflare/followers","following_url":"https://api.github.com/users/cloudflare/following{/other_user}","gists_url":"https://api.github.com/users/cloudflare/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudflare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudflare/subscriptions","organizations_url":"https://api.github.com/users/cloudflare/orgs","repos_url":"https://api.github.com/users/cloudflare/repos","events_url":"https://api.github.com/users/cloudflare/events{/privacy}","received_events_url":"https://api.github.com/users/cloudflare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudflare/cfssl","description":"CFSSL: CloudFlare's PKI toolkit","fork":false,"url":"https://api.github.com/repos/cloudflare/cfssl","forks_url":"https://api.github.com/repos/cloudflare/cfssl/forks","keys_url":"https://api.github.com/repos/cloudflare/cfssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudflare/cfssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudflare/cfssl/teams","hooks_url":"https://api.github.com/repos/cloudflare/cfssl/hooks","issue_events_url":"https://api.github.com/repos/cloudflare/cfssl/issues/events{/number}","events_url":"https://api.github.com/repos/cloudflare/cfssl/events","assignees_url":"https://api.github.com/repos/cloudflare/cfssl/assignees{/user}","branches_url":"https://api.github.com/repos/cloudflare/cfssl/branches{/branch}","tags_url":"https://api.github.com/repos/cloudflare/cfssl/tags","blobs_url":"https://api.github.com/repos/cloudflare/cfssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudflare/cfssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudflare/cfssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudflare/cfssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudflare/cfssl/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudflare/cfssl/languages","stargazers_url":"https://api.github.com/repos/cloudflare/cfssl/stargazers","contributors_url":"https://api.github.com/repos/cloudflare/cfssl/contributors","subscribers_url":"https://api.github.com/repos/cloudflare/cfssl/subscribers","subscription_url":"https://api.github.com/repos/cloudflare/cfssl/subscription","commits_url":"https://api.github.com/repos/cloudflare/cfssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudflare/cfssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudflare/cfssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudflare/cfssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudflare/cfssl/contents/{+path}","compare_url":"https://api.github.com/repos/cloudflare/cfssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudflare/cfssl/merges","archive_url":"https://api.github.com/repos/cloudflare/cfssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudflare/cfssl/downloads","issues_url":"https://api.github.com/repos/cloudflare/cfssl/issues{/number}","pulls_url":"https://api.github.com/repos/cloudflare/cfssl/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudflare/cfssl/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudflare/cfssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudflare/cfssl/labels{/name}","releases_url":"https://api.github.com/repos/cloudflare/cfssl/releases{/id}","created_at":"2014-07-07T23:49:12Z","updated_at":"2015-02-24T19:22:11Z","pushed_at":"2015-02-24T19:22:11Z","git_url":"git://github.com/cloudflare/cfssl.git","ssh_url":"git@github.com:cloudflare/cfssl.git","clone_url":"https://github.com/cloudflare/cfssl.git","svn_url":"https://github.com/cloudflare/cfssl","homepage":"https://blog.cloudflare.com/introducing-cfssl","size":4773,"stargazers_count":453,"watchers_count":453,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":18,"forks":33,"open_issues":18,"watchers":453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudflare/cfssl/pulls/73"},"html":{"href":"https://github.com/cloudflare/cfssl/pull/73"},"issue":{"href":"https://api.github.com/repos/cloudflare/cfssl/issues/73"},"comments":{"href":"https://api.github.com/repos/cloudflare/cfssl/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudflare/cfssl/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudflare/cfssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudflare/cfssl/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/cloudflare/cfssl/statuses/8f83278aaca0d0f94bf0c2cf7ae6e0f625204413"}}}}