{"action":"closed","number":879,"pull_request":{"url":"https://api.github.com/repos/erlang/otp/pulls/879","id":49052304,"html_url":"https://github.com/erlang/otp/pull/879","diff_url":"https://github.com/erlang/otp/pull/879.diff","patch_url":"https://github.com/erlang/otp/pull/879.patch","issue_url":"https://api.github.com/repos/erlang/otp/issues/879","number":879,"state":"closed","locked":false,"title":"Avoid crash for SSL connections with nonexistent keyfile","user":{"login":"legoscia","id":82455,"avatar_url":"https://avatars.githubusercontent.com/u/82455?v=3","gravatar_id":"","url":"https://api.github.com/users/legoscia","html_url":"https://github.com/legoscia","followers_url":"https://api.github.com/users/legoscia/followers","following_url":"https://api.github.com/users/legoscia/following{/other_user}","gists_url":"https://api.github.com/users/legoscia/gists{/gist_id}","starred_url":"https://api.github.com/users/legoscia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legoscia/subscriptions","organizations_url":"https://api.github.com/users/legoscia/orgs","repos_url":"https://api.github.com/users/legoscia/repos","events_url":"https://api.github.com/users/legoscia/events{/privacy}","received_events_url":"https://api.github.com/users/legoscia/received_events","type":"User","site_admin":false},"body":"Starting an SSL connection with a nonexistent keyfile will obviously\r\nreturn an error:\r\n\r\n    > ssl:connect(\"www.google.com\", 443, [{keyfile, \"nonexistent\"}]).\r\n    {error,{options,{keyfile,\"nonexistent\",{error,enoent}}}}\r\n\r\nBut it also generates an error report with the following backtrace:\r\n\r\n    ** Reason for termination =\r\n    ** {badarg,[{ets,select_delete,\r\n                     [undefined,[{{{undefined,'_','_'},'_'},[],[true]}]],\r\n                     []},\r\n                {ets,match_delete,2,[{file,\"ets.erl\"},{line,700}]},\r\n                {ssl_pkix_db,remove_certs,2,[{file,\"ssl_pkix_db.erl\"},{line,243}]},\r\n                {ssl_connection,terminate,3,\r\n                                [{file,\"ssl_connection.erl\"},{line,941}]},\r\n                {tls_connection,terminate,3,\r\n                                [{file,\"tls_connection.erl\"},{line,335}]},\r\n                {gen_fsm,terminate,7,[{file,\"gen_fsm.erl\"},{line,610}]},\r\n                {gen_fsm,handle_msg,7,[{file,\"gen_fsm.erl\"},{line,532}]},\r\n                {proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,240}]}]}\r\n\r\nThis happens because the ssl_connection process receives its cert_db\r\nwhile handling the {start, Timeout} message, but if the handshake\r\nfails, the cert_db will never be inserted into the state data, and the\r\nterminate function will use 'undefined' as an ETS table name.\r\n\r\nAvoid this by checking for 'undefined' in the handle_trusted_certs_db\r\nfunction.","created_at":"2015-10-28T19:05:45Z","updated_at":"2015-11-27T10:18:07Z","closed_at":"2015-11-27T10:18:07Z","merged_at":"2015-11-27T10:18:07Z","merge_commit_sha":"7b4d46c47fa2c9e9c6174b80359c45dfbf6ddecd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/erlang/otp/pulls/879/commits","review_comments_url":"https://api.github.com/repos/erlang/otp/pulls/879/comments","review_comment_url":"https://api.github.com/repos/erlang/otp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/erlang/otp/issues/879/comments","statuses_url":"https://api.github.com/repos/erlang/otp/statuses/3dc5591d92876070e004242ff875b3f04ff92c34","head":{"label":"legoscia:ssl_connection_terminate_crash","ref":"ssl_connection_terminate_crash","sha":"3dc5591d92876070e004242ff875b3f04ff92c34","user":{"login":"legoscia","id":82455,"avatar_url":"https://avatars.githubusercontent.com/u/82455?v=3","gravatar_id":"","url":"https://api.github.com/users/legoscia","html_url":"https://github.com/legoscia","followers_url":"https://api.github.com/users/legoscia/followers","following_url":"https://api.github.com/users/legoscia/following{/other_user}","gists_url":"https://api.github.com/users/legoscia/gists{/gist_id}","starred_url":"https://api.github.com/users/legoscia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legoscia/subscriptions","organizations_url":"https://api.github.com/users/legoscia/orgs","repos_url":"https://api.github.com/users/legoscia/repos","events_url":"https://api.github.com/users/legoscia/events{/privacy}","received_events_url":"https://api.github.com/users/legoscia/received_events","type":"User","site_admin":false},"repo":{"id":387822,"name":"otp","full_name":"legoscia/otp","owner":{"login":"legoscia","id":82455,"avatar_url":"https://avatars.githubusercontent.com/u/82455?v=3","gravatar_id":"","url":"https://api.github.com/users/legoscia","html_url":"https://github.com/legoscia","followers_url":"https://api.github.com/users/legoscia/followers","following_url":"https://api.github.com/users/legoscia/following{/other_user}","gists_url":"https://api.github.com/users/legoscia/gists{/gist_id}","starred_url":"https://api.github.com/users/legoscia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legoscia/subscriptions","organizations_url":"https://api.github.com/users/legoscia/orgs","repos_url":"https://api.github.com/users/legoscia/repos","events_url":"https://api.github.com/users/legoscia/events{/privacy}","received_events_url":"https://api.github.com/users/legoscia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/legoscia/otp","description":"Erlang/OTP","fork":true,"url":"https://api.github.com/repos/legoscia/otp","forks_url":"https://api.github.com/repos/legoscia/otp/forks","keys_url":"https://api.github.com/repos/legoscia/otp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/legoscia/otp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/legoscia/otp/teams","hooks_url":"https://api.github.com/repos/legoscia/otp/hooks","issue_events_url":"https://api.github.com/repos/legoscia/otp/issues/events{/number}","events_url":"https://api.github.com/repos/legoscia/otp/events","assignees_url":"https://api.github.com/repos/legoscia/otp/assignees{/user}","branches_url":"https://api.github.com/repos/legoscia/otp/branches{/branch}","tags_url":"https://api.github.com/repos/legoscia/otp/tags","blobs_url":"https://api.github.com/repos/legoscia/otp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/legoscia/otp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/legoscia/otp/git/refs{/sha}","trees_url":"https://api.github.com/repos/legoscia/otp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/legoscia/otp/statuses/{sha}","languages_url":"https://api.github.com/repos/legoscia/otp/languages","stargazers_url":"https://api.github.com/repos/legoscia/otp/stargazers","contributors_url":"https://api.github.com/repos/legoscia/otp/contributors","subscribers_url":"https://api.github.com/repos/legoscia/otp/subscribers","subscription_url":"https://api.github.com/repos/legoscia/otp/subscription","commits_url":"https://api.github.com/repos/legoscia/otp/commits{/sha}","git_commits_url":"https://api.github.com/repos/legoscia/otp/git/commits{/sha}","comments_url":"https://api.github.com/repos/legoscia/otp/comments{/number}","issue_comment_url":"https://api.github.com/repos/legoscia/otp/issues/comments{/number}","contents_url":"https://api.github.com/repos/legoscia/otp/contents/{+path}","compare_url":"https://api.github.com/repos/legoscia/otp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/legoscia/otp/merges","archive_url":"https://api.github.com/repos/legoscia/otp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/legoscia/otp/downloads","issues_url":"https://api.github.com/repos/legoscia/otp/issues{/number}","pulls_url":"https://api.github.com/repos/legoscia/otp/pulls{/number}","milestones_url":"https://api.github.com/repos/legoscia/otp/milestones{/number}","notifications_url":"https://api.github.com/repos/legoscia/otp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/legoscia/otp/labels{/name}","releases_url":"https://api.github.com/repos/legoscia/otp/releases{/id}","created_at":"2009-11-27T21:07:36Z","updated_at":"2014-07-23T09:55:33Z","pushed_at":"2015-11-24T15:17:25Z","git_url":"git://github.com/legoscia/otp.git","ssh_url":"git@github.com:legoscia/otp.git","clone_url":"https://github.com/legoscia/otp.git","svn_url":"https://github.com/legoscia/otp","homepage":"http://erlang.org","size":139428,"stargazers_count":3,"watchers_count":3,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"dogfood-r15b03"}},"base":{"label":"erlang:maint","ref":"maint","sha":"7dc9eefa341fbfae0ebc55a88b96a375c611e3a4","user":{"login":"erlang","id":153393,"avatar_url":"https://avatars.githubusercontent.com/u/153393?v=3","gravatar_id":"","url":"https://api.github.com/users/erlang","html_url":"https://github.com/erlang","followers_url":"https://api.github.com/users/erlang/followers","following_url":"https://api.github.com/users/erlang/following{/other_user}","gists_url":"https://api.github.com/users/erlang/gists{/gist_id}","starred_url":"https://api.github.com/users/erlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erlang/subscriptions","organizations_url":"https://api.github.com/users/erlang/orgs","repos_url":"https://api.github.com/users/erlang/repos","events_url":"https://api.github.com/users/erlang/events{/privacy}","received_events_url":"https://api.github.com/users/erlang/received_events","type":"Organization","site_admin":false},"repo":{"id":374927,"name":"otp","full_name":"erlang/otp","owner":{"login":"erlang","id":153393,"avatar_url":"https://avatars.githubusercontent.com/u/153393?v=3","gravatar_id":"","url":"https://api.github.com/users/erlang","html_url":"https://github.com/erlang","followers_url":"https://api.github.com/users/erlang/followers","following_url":"https://api.github.com/users/erlang/following{/other_user}","gists_url":"https://api.github.com/users/erlang/gists{/gist_id}","starred_url":"https://api.github.com/users/erlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erlang/subscriptions","organizations_url":"https://api.github.com/users/erlang/orgs","repos_url":"https://api.github.com/users/erlang/repos","events_url":"https://api.github.com/users/erlang/events{/privacy}","received_events_url":"https://api.github.com/users/erlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erlang/otp","description":"Erlang/OTP","fork":false,"url":"https://api.github.com/repos/erlang/otp","forks_url":"https://api.github.com/repos/erlang/otp/forks","keys_url":"https://api.github.com/repos/erlang/otp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erlang/otp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erlang/otp/teams","hooks_url":"https://api.github.com/repos/erlang/otp/hooks","issue_events_url":"https://api.github.com/repos/erlang/otp/issues/events{/number}","events_url":"https://api.github.com/repos/erlang/otp/events","assignees_url":"https://api.github.com/repos/erlang/otp/assignees{/user}","branches_url":"https://api.github.com/repos/erlang/otp/branches{/branch}","tags_url":"https://api.github.com/repos/erlang/otp/tags","blobs_url":"https://api.github.com/repos/erlang/otp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erlang/otp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erlang/otp/git/refs{/sha}","trees_url":"https://api.github.com/repos/erlang/otp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erlang/otp/statuses/{sha}","languages_url":"https://api.github.com/repos/erlang/otp/languages","stargazers_url":"https://api.github.com/repos/erlang/otp/stargazers","contributors_url":"https://api.github.com/repos/erlang/otp/contributors","subscribers_url":"https://api.github.com/repos/erlang/otp/subscribers","subscription_url":"https://api.github.com/repos/erlang/otp/subscription","commits_url":"https://api.github.com/repos/erlang/otp/commits{/sha}","git_commits_url":"https://api.github.com/repos/erlang/otp/git/commits{/sha}","comments_url":"https://api.github.com/repos/erlang/otp/comments{/number}","issue_comment_url":"https://api.github.com/repos/erlang/otp/issues/comments{/number}","contents_url":"https://api.github.com/repos/erlang/otp/contents/{+path}","compare_url":"https://api.github.com/repos/erlang/otp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erlang/otp/merges","archive_url":"https://api.github.com/repos/erlang/otp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erlang/otp/downloads","issues_url":"https://api.github.com/repos/erlang/otp/issues{/number}","pulls_url":"https://api.github.com/repos/erlang/otp/pulls{/number}","milestones_url":"https://api.github.com/repos/erlang/otp/milestones{/number}","notifications_url":"https://api.github.com/repos/erlang/otp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erlang/otp/labels{/name}","releases_url":"https://api.github.com/repos/erlang/otp/releases{/id}","created_at":"2009-11-16T17:17:57Z","updated_at":"2015-11-27T05:54:27Z","pushed_at":"2015-11-27T10:18:01Z","git_url":"git://github.com/erlang/otp.git","ssh_url":"git@github.com:erlang/otp.git","clone_url":"https://github.com/erlang/otp.git","svn_url":"https://github.com/erlang/otp","homepage":"http://erlang.org","size":149126,"stargazers_count":3940,"watchers_count":3940,"language":"Erlang","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":1198,"mirror_url":null,"open_issues_count":65,"forks":1198,"open_issues":65,"watchers":3940,"default_branch":"maint"}},"_links":{"self":{"href":"https://api.github.com/repos/erlang/otp/pulls/879"},"html":{"href":"https://github.com/erlang/otp/pull/879"},"issue":{"href":"https://api.github.com/repos/erlang/otp/issues/879"},"comments":{"href":"https://api.github.com/repos/erlang/otp/issues/879/comments"},"review_comments":{"href":"https://api.github.com/repos/erlang/otp/pulls/879/comments"},"review_comment":{"href":"https://api.github.com/repos/erlang/otp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/erlang/otp/pulls/879/commits"},"statuses":{"href":"https://api.github.com/repos/erlang/otp/statuses/3dc5591d92876070e004242ff875b3f04ff92c34"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"zhird","id":10808088,"avatar_url":"https://avatars.githubusercontent.com/u/10808088?v=3","gravatar_id":"","url":"https://api.github.com/users/zhird","html_url":"https://github.com/zhird","followers_url":"https://api.github.com/users/zhird/followers","following_url":"https://api.github.com/users/zhird/following{/other_user}","gists_url":"https://api.github.com/users/zhird/gists{/gist_id}","starred_url":"https://api.github.com/users/zhird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhird/subscriptions","organizations_url":"https://api.github.com/users/zhird/orgs","repos_url":"https://api.github.com/users/zhird/repos","events_url":"https://api.github.com/users/zhird/events{/privacy}","received_events_url":"https://api.github.com/users/zhird/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}