{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/s2n/pulls/comments/66195426","id":66195426,"diff_hunk":"@@ -0,0 +1,78 @@\n+#\n+# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\").\n+# You may not use this file except in compliance with the License.\n+# A copy of the License is located at\n+#\n+#  http://aws.amazon.com/apache2.0\n+#\n+# or in the \"license\" file accompanying this file. This file is distributed\n+# on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+# express or implied. See the License for the specific language governing\n+# permissions and limitations under the License.\n+#\n+\n+import sys\n+import ssl\n+import socket\n+\n+# All supported ciphers\n+S2N_CIPHERS=[\n+    \"RC4-MD5\",\n+    \"RC4-SHA\",\n+    \"DES-CBC3-SHA\",\n+    \"EDH-RSA-DES-CBC3-SHA\",\n+    \"AES128-SHA\",\n+    \"DHE-RSA-AES128-SHA\",\n+    \"AES256-SHA\",\n+    \"DHE-RSA-AES256-SHA\",\n+    \"AES128-SHA256\",\n+    \"AES256-SHA256\",\n+    \"DHE-RSA-AES128-SHA256\",\n+    \"DHE-RSA-AES256-SHA256\",\n+    \"AES128-GCM-SHA256\",\n+    \"DHE-RSA-AES128-GCM-SHA256\",\n+    \"ECDHE-RSA-DES-CBC3-SHA\",\n+    \"ECDHE-RSA-AES128-SHA\",\n+    \"ECDHE-RSA-AES256-SHA\",\n+    \"ECDHE-RSA-AES128-SHA256\",\n+    \"ECDHE-RSA-AES256-SHA384\",\n+    \"ECDHE-RSA-AES128-GCM-SHA256\",\n+    \"ECDHE-RSA-AES256-GCM-SHA384\",\n+]\n+\n+def try_handshake(endpoint, port, cipher):\n+    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n+    sock.settimeout(1)\n+    try:\n+        ssl_sock = ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1_2, ciphers=cipher)\n+    except ssl.SSLError as err:\n+        print str(err)\n+        return -1\n+    try:\n+        ssl_sock.connect((endpoint, port))\n+    except Exception as err:\n+        print str(err)\n+        return -1\n+    else:\n+        return 0\n+\n+def main(argv):\n+    if len(argv) < 2:\n+        print \"handshake_test.py host port\"","path":"tests/integration/s2n_handshake_test.py","position":63,"original_position":63,"commit_id":"dcc066dc521abaf35b7c882c34f1192b042c3da9","original_commit_id":"dcc066dc521abaf35b7c882c34f1192b042c3da9","user":{"login":"colmmacc","id":172568,"avatar_url":"https://avatars.githubusercontent.com/u/172568?v=3","gravatar_id":"","url":"https://api.github.com/users/colmmacc","html_url":"https://github.com/colmmacc","followers_url":"https://api.github.com/users/colmmacc/followers","following_url":"https://api.github.com/users/colmmacc/following{/other_user}","gists_url":"https://api.github.com/users/colmmacc/gists{/gist_id}","starred_url":"https://api.github.com/users/colmmacc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colmmacc/subscriptions","organizations_url":"https://api.github.com/users/colmmacc/orgs","repos_url":"https://api.github.com/users/colmmacc/repos","events_url":"https://api.github.com/users/colmmacc/events{/privacy}","received_events_url":"https://api.github.com/users/colmmacc/received_events","type":"User","site_admin":false},"body":"looks like the name changed","created_at":"2016-06-08T05:45:30Z","updated_at":"2016-06-08T05:45:30Z","html_url":"https://github.com/awslabs/s2n/pull/222#discussion_r66195426","pull_request_url":"https://api.github.com/repos/awslabs/s2n/pulls/222","_links":{"self":{"href":"https://api.github.com/repos/awslabs/s2n/pulls/comments/66195426"},"html":{"href":"https://github.com/awslabs/s2n/pull/222#discussion_r66195426"},"pull_request":{"href":"https://api.github.com/repos/awslabs/s2n/pulls/222"}}},"pull_request":{"url":"https://api.github.com/repos/awslabs/s2n/pulls/222","id":72577582,"html_url":"https://github.com/awslabs/s2n/pull/222","diff_url":"https://github.com/awslabs/s2n/pull/222.diff","patch_url":"https://github.com/awslabs/s2n/pull/222.patch","issue_url":"https://api.github.com/repos/awslabs/s2n/issues/222","number":222,"state":"open","locked":false,"title":"Add a basic handshake integration test","user":{"login":"raycoll","id":4444641,"avatar_url":"https://avatars.githubusercontent.com/u/4444641?v=3","gravatar_id":"","url":"https://api.github.com/users/raycoll","html_url":"https://github.com/raycoll","followers_url":"https://api.github.com/users/raycoll/followers","following_url":"https://api.github.com/users/raycoll/following{/other_user}","gists_url":"https://api.github.com/users/raycoll/gists{/gist_id}","starred_url":"https://api.github.com/users/raycoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raycoll/subscriptions","organizations_url":"https://api.github.com/users/raycoll/orgs","repos_url":"https://api.github.com/users/raycoll/repos","events_url":"https://api.github.com/users/raycoll/events{/privacy}","received_events_url":"https://api.github.com/users/raycoll/received_events","type":"User","site_admin":false},"body":"This change adds a handshake integration test via an Openssl based\r\nPython client. The intention is to have this test run against s2nd\r\nin TravisCI. That way we'll get feedback on handshake regression as\r\nchanges are added to s2n. Any time new cipher suites are added to s2n,\r\nwe should also add them to s2n_handshake_test.py. In the future, we could\r\nhave it test different combinations of cipher suite and protocol version.\r\n\r\nIt would be tricky to make this a build requirement because\r\nof the dependencies required(Openssl, Python > 2.7.10).\r\n\r\n----\r\n\r\nI waffled between using a shell script + s_client vs python. The python option requires us to pull in another dependency but it makes adding new tests easier.\r\n\r\nNOTE: the Travis build is failing because we can't currently negotiate certain cipher suites :), blocked on #219 ","created_at":"2016-06-03T22:16:01Z","updated_at":"2016-06-08T05:45:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f79f82fb7f485add488c2172625f3a25417ae630","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/s2n/pulls/222/commits","review_comments_url":"https://api.github.com/repos/awslabs/s2n/pulls/222/comments","review_comment_url":"https://api.github.com/repos/awslabs/s2n/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/s2n/issues/222/comments","statuses_url":"https://api.github.com/repos/awslabs/s2n/statuses/dcc066dc521abaf35b7c882c34f1192b042c3da9","head":{"label":"raycoll:handshake_int_test","ref":"handshake_int_test","sha":"dcc066dc521abaf35b7c882c34f1192b042c3da9","user":{"login":"raycoll","id":4444641,"avatar_url":"https://avatars.githubusercontent.com/u/4444641?v=3","gravatar_id":"","url":"https://api.github.com/users/raycoll","html_url":"https://github.com/raycoll","followers_url":"https://api.github.com/users/raycoll/followers","following_url":"https://api.github.com/users/raycoll/following{/other_user}","gists_url":"https://api.github.com/users/raycoll/gists{/gist_id}","starred_url":"https://api.github.com/users/raycoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raycoll/subscriptions","organizations_url":"https://api.github.com/users/raycoll/orgs","repos_url":"https://api.github.com/users/raycoll/repos","events_url":"https://api.github.com/users/raycoll/events{/privacy}","received_events_url":"https://api.github.com/users/raycoll/received_events","type":"User","site_admin":false},"repo":{"id":49685354,"name":"s2n","full_name":"raycoll/s2n","owner":{"login":"raycoll","id":4444641,"avatar_url":"https://avatars.githubusercontent.com/u/4444641?v=3","gravatar_id":"","url":"https://api.github.com/users/raycoll","html_url":"https://github.com/raycoll","followers_url":"https://api.github.com/users/raycoll/followers","following_url":"https://api.github.com/users/raycoll/following{/other_user}","gists_url":"https://api.github.com/users/raycoll/gists{/gist_id}","starred_url":"https://api.github.com/users/raycoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raycoll/subscriptions","organizations_url":"https://api.github.com/users/raycoll/orgs","repos_url":"https://api.github.com/users/raycoll/repos","events_url":"https://api.github.com/users/raycoll/events{/privacy}","received_events_url":"https://api.github.com/users/raycoll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/raycoll/s2n","description":"s2n : an implementation of the TLS/SSL protocols","fork":true,"url":"https://api.github.com/repos/raycoll/s2n","forks_url":"https://api.github.com/repos/raycoll/s2n/forks","keys_url":"https://api.github.com/repos/raycoll/s2n/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raycoll/s2n/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raycoll/s2n/teams","hooks_url":"https://api.github.com/repos/raycoll/s2n/hooks","issue_events_url":"https://api.github.com/repos/raycoll/s2n/issues/events{/number}","events_url":"https://api.github.com/repos/raycoll/s2n/events","assignees_url":"https://api.github.com/repos/raycoll/s2n/assignees{/user}","branches_url":"https://api.github.com/repos/raycoll/s2n/branches{/branch}","tags_url":"https://api.github.com/repos/raycoll/s2n/tags","blobs_url":"https://api.github.com/repos/raycoll/s2n/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raycoll/s2n/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raycoll/s2n/git/refs{/sha}","trees_url":"https://api.github.com/repos/raycoll/s2n/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raycoll/s2n/statuses/{sha}","languages_url":"https://api.github.com/repos/raycoll/s2n/languages","stargazers_url":"https://api.github.com/repos/raycoll/s2n/stargazers","contributors_url":"https://api.github.com/repos/raycoll/s2n/contributors","subscribers_url":"https://api.github.com/repos/raycoll/s2n/subscribers","subscription_url":"https://api.github.com/repos/raycoll/s2n/subscription","commits_url":"https://api.github.com/repos/raycoll/s2n/commits{/sha}","git_commits_url":"https://api.github.com/repos/raycoll/s2n/git/commits{/sha}","comments_url":"https://api.github.com/repos/raycoll/s2n/comments{/number}","issue_comment_url":"https://api.github.com/repos/raycoll/s2n/issues/comments{/number}","contents_url":"https://api.github.com/repos/raycoll/s2n/contents/{+path}","compare_url":"https://api.github.com/repos/raycoll/s2n/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raycoll/s2n/merges","archive_url":"https://api.github.com/repos/raycoll/s2n/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raycoll/s2n/downloads","issues_url":"https://api.github.com/repos/raycoll/s2n/issues{/number}","pulls_url":"https://api.github.com/repos/raycoll/s2n/pulls{/number}","milestones_url":"https://api.github.com/repos/raycoll/s2n/milestones{/number}","notifications_url":"https://api.github.com/repos/raycoll/s2n/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raycoll/s2n/labels{/name}","releases_url":"https://api.github.com/repos/raycoll/s2n/releases{/id}","deployments_url":"https://api.github.com/repos/raycoll/s2n/deployments","created_at":"2016-01-15T00:51:01Z","updated_at":"2016-01-15T00:51:02Z","pushed_at":"2016-06-08T05:41:25Z","git_url":"git://github.com/raycoll/s2n.git","ssh_url":"git@github.com:raycoll/s2n.git","clone_url":"https://github.com/raycoll/s2n.git","svn_url":"https://github.com/raycoll/s2n","homepage":"","size":1126,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"awslabs:master","ref":"master","sha":"e087a40a5a1bb5d409bb0629f7dfb691e7187044","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":21287076,"name":"s2n","full_name":"awslabs/s2n","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/s2n","description":"s2n : an implementation of the TLS/SSL protocols","fork":false,"url":"https://api.github.com/repos/awslabs/s2n","forks_url":"https://api.github.com/repos/awslabs/s2n/forks","keys_url":"https://api.github.com/repos/awslabs/s2n/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/s2n/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/s2n/teams","hooks_url":"https://api.github.com/repos/awslabs/s2n/hooks","issue_events_url":"https://api.github.com/repos/awslabs/s2n/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/s2n/events","assignees_url":"https://api.github.com/repos/awslabs/s2n/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/s2n/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/s2n/tags","blobs_url":"https://api.github.com/repos/awslabs/s2n/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/s2n/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/s2n/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/s2n/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/s2n/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/s2n/languages","stargazers_url":"https://api.github.com/repos/awslabs/s2n/stargazers","contributors_url":"https://api.github.com/repos/awslabs/s2n/contributors","subscribers_url":"https://api.github.com/repos/awslabs/s2n/subscribers","subscription_url":"https://api.github.com/repos/awslabs/s2n/subscription","commits_url":"https://api.github.com/repos/awslabs/s2n/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/s2n/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/s2n/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/s2n/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/s2n/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/s2n/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/s2n/merges","archive_url":"https://api.github.com/repos/awslabs/s2n/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/s2n/downloads","issues_url":"https://api.github.com/repos/awslabs/s2n/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/s2n/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/s2n/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/s2n/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/s2n/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/s2n/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/s2n/deployments","created_at":"2014-06-27T19:37:59Z","updated_at":"2016-06-07T11:29:26Z","pushed_at":"2016-06-08T05:40:36Z","git_url":"git://github.com/awslabs/s2n.git","ssh_url":"git@github.com:awslabs/s2n.git","clone_url":"https://github.com/awslabs/s2n.git","svn_url":"https://github.com/awslabs/s2n","homepage":"","size":1604,"stargazers_count":2295,"watchers_count":2295,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":192,"mirror_url":null,"open_issues_count":35,"forks":192,"open_issues":35,"watchers":2295,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/s2n/pulls/222"},"html":{"href":"https://github.com/awslabs/s2n/pull/222"},"issue":{"href":"https://api.github.com/repos/awslabs/s2n/issues/222"},"comments":{"href":"https://api.github.com/repos/awslabs/s2n/issues/222/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/s2n/pulls/222/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/s2n/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/s2n/pulls/222/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/s2n/statuses/dcc066dc521abaf35b7c882c34f1192b042c3da9"}}}}
{"actor":{"display_login":"colmmacc"}}