{"action":"created","comment":{"url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/comments/123653004","pull_request_review_id":45879169,"id":123653004,"diff_hunk":"@@ -526,47 +526,81 @@ private void VerifyConnected()\n \n \t\tprivate async Task InitSslAsync(ProtocolCapabilities serverCapabilities, ConnectionSettings cs, IOBehavior ioBehavior, CancellationToken cancellationToken)\n \t\t{\n-\t\t\tX509CertificateCollection clientCertificates = null;\n+\t\t\tX509CertificateCollection CertificateFiles = null;\n \t\t\tif (cs.CertificateFile != null)\n \t\t\t{\n \t\t\t\ttry\n \t\t\t\t{\n-\t\t\t\t\tvar certificate = new X509Certificate2(cs.CertificateFile, cs.CertificatePassword);\n-\t\t\t\t\tclientCertificates = new X509CertificateCollection {certificate};\n+\t\t\t\t\tX509Certificate2 certificate;\n+\t\t\t\t\tif (cs.CertificatePassword == null)\n+\t\t\t\t\t\tcertificate = new X509Certificate2(cs.CertificateFile);\n+\t\t\t\t\telse\n+\t\t\t\t\t\tcertificate = new X509Certificate2(cs.CertificateFile, cs.CertificatePassword);","path":"src/MySqlConnector/Serialization/MySqlSession.cs","position":16,"original_position":16,"commit_id":"0721552834c0c2f03f9de209d4f12201573894ed","original_commit_id":"0721552834c0c2f03f9de209d4f12201573894ed","user":{"login":"caleblloyd","id":2414837,"avatar_url":"https://avatars3.githubusercontent.com/u/2414837?v=3","gravatar_id":"","url":"https://api.github.com/users/caleblloyd","html_url":"https://github.com/caleblloyd","followers_url":"https://api.github.com/users/caleblloyd/followers","following_url":"https://api.github.com/users/caleblloyd/following{/other_user}","gists_url":"https://api.github.com/users/caleblloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/caleblloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleblloyd/subscriptions","organizations_url":"https://api.github.com/users/caleblloyd/orgs","repos_url":"https://api.github.com/users/caleblloyd/repos","events_url":"https://api.github.com/users/caleblloyd/events{/privacy}","received_events_url":"https://api.github.com/users/caleblloyd/received_events","type":"User","site_admin":false},"body":"Thanks for the CoreFX link. I wanted to make sure importing PEM encoded certs would work too and usually those aren't password protected. I'll change it back though since it runs through the same codepath.","created_at":"2017-06-23T00:45:56Z","updated_at":"2017-06-23T00:45:56Z","html_url":"https://github.com/mysql-net/MySqlConnector/pull/280#discussion_r123653004","pull_request_url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280","_links":{"self":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/comments/123653004"},"html":{"href":"https://github.com/mysql-net/MySqlConnector/pull/280#discussion_r123653004"},"pull_request":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280"}}},"pull_request":{"url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280","id":126993316,"html_url":"https://github.com/mysql-net/MySqlConnector/pull/280","diff_url":"https://github.com/mysql-net/MySqlConnector/pull/280.diff","patch_url":"https://github.com/mysql-net/MySqlConnector/pull/280.patch","issue_url":"https://api.github.com/repos/mysql-net/MySqlConnector/issues/280","number":280,"state":"open","locked":false,"title":"Add CA Certificate validation","user":{"login":"caleblloyd","id":2414837,"avatar_url":"https://avatars3.githubusercontent.com/u/2414837?v=3","gravatar_id":"","url":"https://api.github.com/users/caleblloyd","html_url":"https://github.com/caleblloyd","followers_url":"https://api.github.com/users/caleblloyd/followers","following_url":"https://api.github.com/users/caleblloyd/following{/other_user}","gists_url":"https://api.github.com/users/caleblloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/caleblloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleblloyd/subscriptions","organizations_url":"https://api.github.com/users/caleblloyd/orgs","repos_url":"https://api.github.com/users/caleblloyd/repos","events_url":"https://api.github.com/users/caleblloyd/events{/privacy}","received_events_url":"https://api.github.com/users/caleblloyd/received_events","type":"User","site_admin":false},"body":"- Fixes #278 \r\n- Please review for technical issues.  I took most of the implementation from [the two SO answers here](https://stackoverflow.com/questions/7695438/verify-remote-server-x509certificate-using-ca-certificate-file).  If there is a better way to validate certificate chains, comment away.\r\n- I've hand tested; need to write Unit tests for this before it is ready to be merged","created_at":"2017-06-22T13:33:28Z","updated_at":"2017-06-23T00:45:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f3db8de6f8c34593683d1f227a7e6bc2bb1b13f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280/commits","review_comments_url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280/comments","review_comment_url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysql-net/MySqlConnector/issues/280/comments","statuses_url":"https://api.github.com/repos/mysql-net/MySqlConnector/statuses/0721552834c0c2f03f9de209d4f12201573894ed","head":{"label":"caleblloyd:f_ssl_ca","ref":"f_ssl_ca","sha":"0721552834c0c2f03f9de209d4f12201573894ed","user":{"login":"caleblloyd","id":2414837,"avatar_url":"https://avatars3.githubusercontent.com/u/2414837?v=3","gravatar_id":"","url":"https://api.github.com/users/caleblloyd","html_url":"https://github.com/caleblloyd","followers_url":"https://api.github.com/users/caleblloyd/followers","following_url":"https://api.github.com/users/caleblloyd/following{/other_user}","gists_url":"https://api.github.com/users/caleblloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/caleblloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleblloyd/subscriptions","organizations_url":"https://api.github.com/users/caleblloyd/orgs","repos_url":"https://api.github.com/users/caleblloyd/repos","events_url":"https://api.github.com/users/caleblloyd/events{/privacy}","received_events_url":"https://api.github.com/users/caleblloyd/received_events","type":"User","site_admin":false},"repo":{"id":67824910,"name":"MySqlConnector","full_name":"caleblloyd/MySqlConnector","owner":{"login":"caleblloyd","id":2414837,"avatar_url":"https://avatars3.githubusercontent.com/u/2414837?v=3","gravatar_id":"","url":"https://api.github.com/users/caleblloyd","html_url":"https://github.com/caleblloyd","followers_url":"https://api.github.com/users/caleblloyd/followers","following_url":"https://api.github.com/users/caleblloyd/following{/other_user}","gists_url":"https://api.github.com/users/caleblloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/caleblloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleblloyd/subscriptions","organizations_url":"https://api.github.com/users/caleblloyd/orgs","repos_url":"https://api.github.com/users/caleblloyd/repos","events_url":"https://api.github.com/users/caleblloyd/events{/privacy}","received_events_url":"https://api.github.com/users/caleblloyd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caleblloyd/MySqlConnector","description":"Async MySql.Data replacement for .NET Core","fork":true,"url":"https://api.github.com/repos/caleblloyd/MySqlConnector","forks_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/forks","keys_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/teams","hooks_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/hooks","issue_events_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/issues/events{/number}","events_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/events","assignees_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/assignees{/user}","branches_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/branches{/branch}","tags_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/tags","blobs_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/git/refs{/sha}","trees_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/statuses/{sha}","languages_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/languages","stargazers_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/stargazers","contributors_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/contributors","subscribers_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/subscribers","subscription_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/subscription","commits_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/commits{/sha}","git_commits_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/git/commits{/sha}","comments_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/comments{/number}","issue_comment_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/issues/comments{/number}","contents_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/contents/{+path}","compare_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/merges","archive_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/downloads","issues_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/issues{/number}","pulls_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/pulls{/number}","milestones_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/milestones{/number}","notifications_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/labels{/name}","releases_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/releases{/id}","deployments_url":"https://api.github.com/repos/caleblloyd/MySqlConnector/deployments","created_at":"2016-09-09T19:03:06Z","updated_at":"2016-09-09T19:03:07Z","pushed_at":"2017-06-22T17:19:08Z","git_url":"git://github.com/caleblloyd/MySqlConnector.git","ssh_url":"git@github.com:caleblloyd/MySqlConnector.git","clone_url":"https://github.com/caleblloyd/MySqlConnector.git","svn_url":"https://github.com/caleblloyd/MySqlConnector","homepage":null,"size":1884,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"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":"mysql-net:master","ref":"master","sha":"ab35d343ab18b2126c8de9a0f861f16f90f793f3","user":{"login":"mysql-net","id":22824958,"avatar_url":"https://avatars0.githubusercontent.com/u/22824958?v=3","gravatar_id":"","url":"https://api.github.com/users/mysql-net","html_url":"https://github.com/mysql-net","followers_url":"https://api.github.com/users/mysql-net/followers","following_url":"https://api.github.com/users/mysql-net/following{/other_user}","gists_url":"https://api.github.com/users/mysql-net/gists{/gist_id}","starred_url":"https://api.github.com/users/mysql-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysql-net/subscriptions","organizations_url":"https://api.github.com/users/mysql-net/orgs","repos_url":"https://api.github.com/users/mysql-net/repos","events_url":"https://api.github.com/users/mysql-net/events{/privacy}","received_events_url":"https://api.github.com/users/mysql-net/received_events","type":"Organization","site_admin":false},"repo":{"id":55185530,"name":"MySqlConnector","full_name":"mysql-net/MySqlConnector","owner":{"login":"mysql-net","id":22824958,"avatar_url":"https://avatars0.githubusercontent.com/u/22824958?v=3","gravatar_id":"","url":"https://api.github.com/users/mysql-net","html_url":"https://github.com/mysql-net","followers_url":"https://api.github.com/users/mysql-net/followers","following_url":"https://api.github.com/users/mysql-net/following{/other_user}","gists_url":"https://api.github.com/users/mysql-net/gists{/gist_id}","starred_url":"https://api.github.com/users/mysql-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysql-net/subscriptions","organizations_url":"https://api.github.com/users/mysql-net/orgs","repos_url":"https://api.github.com/users/mysql-net/repos","events_url":"https://api.github.com/users/mysql-net/events{/privacy}","received_events_url":"https://api.github.com/users/mysql-net/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysql-net/MySqlConnector","description":"Async MySQL Connector for .NET and .NET Core","fork":false,"url":"https://api.github.com/repos/mysql-net/MySqlConnector","forks_url":"https://api.github.com/repos/mysql-net/MySqlConnector/forks","keys_url":"https://api.github.com/repos/mysql-net/MySqlConnector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysql-net/MySqlConnector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysql-net/MySqlConnector/teams","hooks_url":"https://api.github.com/repos/mysql-net/MySqlConnector/hooks","issue_events_url":"https://api.github.com/repos/mysql-net/MySqlConnector/issues/events{/number}","events_url":"https://api.github.com/repos/mysql-net/MySqlConnector/events","assignees_url":"https://api.github.com/repos/mysql-net/MySqlConnector/assignees{/user}","branches_url":"https://api.github.com/repos/mysql-net/MySqlConnector/branches{/branch}","tags_url":"https://api.github.com/repos/mysql-net/MySqlConnector/tags","blobs_url":"https://api.github.com/repos/mysql-net/MySqlConnector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysql-net/MySqlConnector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysql-net/MySqlConnector/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysql-net/MySqlConnector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysql-net/MySqlConnector/statuses/{sha}","languages_url":"https://api.github.com/repos/mysql-net/MySqlConnector/languages","stargazers_url":"https://api.github.com/repos/mysql-net/MySqlConnector/stargazers","contributors_url":"https://api.github.com/repos/mysql-net/MySqlConnector/contributors","subscribers_url":"https://api.github.com/repos/mysql-net/MySqlConnector/subscribers","subscription_url":"https://api.github.com/repos/mysql-net/MySqlConnector/subscription","commits_url":"https://api.github.com/repos/mysql-net/MySqlConnector/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysql-net/MySqlConnector/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysql-net/MySqlConnector/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysql-net/MySqlConnector/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysql-net/MySqlConnector/contents/{+path}","compare_url":"https://api.github.com/repos/mysql-net/MySqlConnector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysql-net/MySqlConnector/merges","archive_url":"https://api.github.com/repos/mysql-net/MySqlConnector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysql-net/MySqlConnector/downloads","issues_url":"https://api.github.com/repos/mysql-net/MySqlConnector/issues{/number}","pulls_url":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls{/number}","milestones_url":"https://api.github.com/repos/mysql-net/MySqlConnector/milestones{/number}","notifications_url":"https://api.github.com/repos/mysql-net/MySqlConnector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysql-net/MySqlConnector/labels{/name}","releases_url":"https://api.github.com/repos/mysql-net/MySqlConnector/releases{/id}","deployments_url":"https://api.github.com/repos/mysql-net/MySqlConnector/deployments","created_at":"2016-03-31T21:54:37Z","updated_at":"2017-06-20T14:30:52Z","pushed_at":"2017-06-22T21:53:46Z","git_url":"git://github.com/mysql-net/MySqlConnector.git","ssh_url":"git@github.com:mysql-net/MySqlConnector.git","clone_url":"https://github.com/mysql-net/MySqlConnector.git","svn_url":"https://github.com/mysql-net/MySqlConnector","homepage":"https://mysql-net.github.io/MySqlConnector/","size":2086,"stargazers_count":206,"watchers_count":206,"language":"C#","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":36,"mirror_url":null,"open_issues_count":33,"forks":36,"open_issues":33,"watchers":206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280"},"html":{"href":"https://github.com/mysql-net/MySqlConnector/pull/280"},"issue":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/issues/280"},"comments":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/issues/280/comments"},"review_comments":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280/comments"},"review_comment":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/pulls/280/commits"},"statuses":{"href":"https://api.github.com/repos/mysql-net/MySqlConnector/statuses/0721552834c0c2f03f9de209d4f12201573894ed"}}}}
{"actor":{"display_login":"caleblloyd"}}