{"action":"created","comment":{"url":"https://api.github.com/repos/openssl/openssl/pulls/comments/55927473","id":55927473,"diff_hunk":"@@ -830,6 +830,7 @@ int tls_construct_client_hello(SSL *s)\n         (sess->not_resumable)) {\n         if (!ssl_get_new_session(s, 0))\n             goto err;\n+        s->session->ssl_version = s->version;","path":"ssl/statem/statem_clnt.c","position":4,"original_position":4,"commit_id":"702ce0730e188c2a8d42e4b042162055e2ad2e91","original_commit_id":"95aedaf434f028b508484ace61e0ff3ea1e02bba","user":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"body":"Ack.","created_at":"2016-03-12T20:53:19Z","updated_at":"2016-03-12T20:53:19Z","html_url":"https://github.com/openssl/openssl/pull/852#discussion_r55927473","pull_request_url":"https://api.github.com/repos/openssl/openssl/pulls/852","_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments/55927473"},"html":{"href":"https://github.com/openssl/openssl/pull/852#discussion_r55927473"},"pull_request":{"href":"https://api.github.com/repos/openssl/openssl/pulls/852"}}},"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/852","id":62623909,"html_url":"https://github.com/openssl/openssl/pull/852","diff_url":"https://github.com/openssl/openssl/pull/852.diff","patch_url":"https://github.com/openssl/openssl/pull/852.patch","issue_url":"https://api.github.com/repos/openssl/openssl/issues/852","number":852,"state":"open","locked":false,"title":"statem_clnt: do not override version on sess reuse","user":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"body":"Allow downgrading when reusing sessions on client\r\n\r\nWhen connecting to pool of diverse servers (both TLS1.0 and TLS1.2), a\r\nfollowing scenario may happen:\r\n\r\n  1. Connect to TLS1.2 server, receive new session\r\n  2. Store this session\r\n  3. Attempt to reuse it later when connecting to server\r\n  4. Connect to different server from the pool, which speaks only TLS1.0\r\n  5. Get `SSL_R_WRONG_VERSION_NUMBER` error\r\n\r\nExpected behavior would be scrapping off the session, and allowing\r\nserver to downgrade to supported protocol version the way it would do it\r\nif no client session would be supplied.\r\n\r\ncc @mattcaswell \r\n\r\nSupersedes #603 ","created_at":"2016-03-12T00:49:41Z","updated_at":"2016-03-12T20:53:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fac962da682af53c9ad01105fa544d2630908ab1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openssl/openssl/pulls/852/commits","review_comments_url":"https://api.github.com/repos/openssl/openssl/pulls/852/comments","review_comment_url":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/852/comments","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/702ce0730e188c2a8d42e4b042162055e2ad2e91","head":{"label":"indutny:feature/master-session-reuse","ref":"feature/master-session-reuse","sha":"702ce0730e188c2a8d42e4b042162055e2ad2e91","user":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"repo":{"id":18896922,"name":"openssl","full_name":"indutny/openssl","owner":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/indutny/openssl","description":"","fork":true,"url":"https://api.github.com/repos/indutny/openssl","forks_url":"https://api.github.com/repos/indutny/openssl/forks","keys_url":"https://api.github.com/repos/indutny/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indutny/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indutny/openssl/teams","hooks_url":"https://api.github.com/repos/indutny/openssl/hooks","issue_events_url":"https://api.github.com/repos/indutny/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/indutny/openssl/events","assignees_url":"https://api.github.com/repos/indutny/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/indutny/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/indutny/openssl/tags","blobs_url":"https://api.github.com/repos/indutny/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indutny/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indutny/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/indutny/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indutny/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/indutny/openssl/languages","stargazers_url":"https://api.github.com/repos/indutny/openssl/stargazers","contributors_url":"https://api.github.com/repos/indutny/openssl/contributors","subscribers_url":"https://api.github.com/repos/indutny/openssl/subscribers","subscription_url":"https://api.github.com/repos/indutny/openssl/subscription","commits_url":"https://api.github.com/repos/indutny/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/indutny/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/indutny/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/indutny/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/indutny/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/indutny/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indutny/openssl/merges","archive_url":"https://api.github.com/repos/indutny/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indutny/openssl/downloads","issues_url":"https://api.github.com/repos/indutny/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/indutny/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/indutny/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/indutny/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indutny/openssl/labels{/name}","releases_url":"https://api.github.com/repos/indutny/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/indutny/openssl/deployments","created_at":"2014-04-17T23:49:01Z","updated_at":"2015-02-16T09:48:18Z","pushed_at":"2016-03-12T20:52:02Z","git_url":"git://github.com/indutny/openssl.git","ssh_url":"git@github.com:indutny/openssl.git","clone_url":"https://github.com/indutny/openssl.git","svn_url":"https://github.com/indutny/openssl","homepage":null,"size":80757,"stargazers_count":1,"watchers_count":1,"language":"C","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":1,"default_branch":"master"}},"base":{"label":"openssl:master","ref":"master","sha":"ef75444d0873ab4b35070b6362867b7b712515e6","user":{"login":"openssl","id":3279138,"avatar_url":"https://avatars.githubusercontent.com/u/3279138?v=3","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"repo":{"id":7634677,"name":"openssl","full_name":"openssl/openssl","owner":{"login":"openssl","id":3279138,"avatar_url":"https://avatars.githubusercontent.com/u/3279138?v=3","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openssl/openssl","description":"TLS/SSL and crypto library","fork":false,"url":"https://api.github.com/repos/openssl/openssl","forks_url":"https://api.github.com/repos/openssl/openssl/forks","keys_url":"https://api.github.com/repos/openssl/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openssl/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openssl/openssl/teams","hooks_url":"https://api.github.com/repos/openssl/openssl/hooks","issue_events_url":"https://api.github.com/repos/openssl/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/openssl/openssl/events","assignees_url":"https://api.github.com/repos/openssl/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/openssl/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/openssl/openssl/tags","blobs_url":"https://api.github.com/repos/openssl/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openssl/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openssl/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openssl/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/openssl/openssl/languages","stargazers_url":"https://api.github.com/repos/openssl/openssl/stargazers","contributors_url":"https://api.github.com/repos/openssl/openssl/contributors","subscribers_url":"https://api.github.com/repos/openssl/openssl/subscribers","subscription_url":"https://api.github.com/repos/openssl/openssl/subscription","commits_url":"https://api.github.com/repos/openssl/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openssl/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openssl/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openssl/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openssl/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/openssl/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openssl/openssl/merges","archive_url":"https://api.github.com/repos/openssl/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openssl/openssl/downloads","issues_url":"https://api.github.com/repos/openssl/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/openssl/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/openssl/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/openssl/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openssl/openssl/labels{/name}","releases_url":"https://api.github.com/repos/openssl/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/openssl/openssl/deployments","created_at":"2013-01-15T22:34:48Z","updated_at":"2016-03-12T15:40:18Z","pushed_at":"2016-03-12T20:52:02Z","git_url":"git://github.com/openssl/openssl.git","ssh_url":"git@github.com:openssl/openssl.git","clone_url":"https://github.com/openssl/openssl.git","svn_url":"https://github.com/openssl/openssl","homepage":"https://www.openssl.org","size":92933,"stargazers_count":2272,"watchers_count":2272,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1302,"mirror_url":null,"open_issues_count":133,"forks":1302,"open_issues":133,"watchers":2272,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/852"},"html":{"href":"https://github.com/openssl/openssl/pull/852"},"issue":{"href":"https://api.github.com/repos/openssl/openssl/issues/852"},"comments":{"href":"https://api.github.com/repos/openssl/openssl/issues/852/comments"},"review_comments":{"href":"https://api.github.com/repos/openssl/openssl/pulls/852/comments"},"review_comment":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openssl/openssl/pulls/852/commits"},"statuses":{"href":"https://api.github.com/repos/openssl/openssl/statuses/702ce0730e188c2a8d42e4b042162055e2ad2e91"}}}}