{"action":"created","comment":{"url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/comments/87628480","pull_request_review_id":8236913,"id":87628480,"diff_hunk":"@@ -65,11 +65,13 @@ def sign(message, ssldir=None, certname=None, **config):\n \n     message['crypto'] = 'x509'\n \n-    certificate = M2Crypto.X509.load_cert(\n-        \"%s/%s.crt\" % (ssldir, certname)).as_pem()\n+    marker = \"-----BEGIN CERTIFICATE-----\"\n+    with open(\"%s/%s.crt\" % (ssldir, certname), 'r') as f:\n+        content = marker + f.read().split(marker)[-1]\n+        certificate = M2Crypto.X509.load_cert_string(content).as_pem()\n+\n     # Opening this file requires elevated privileges in stg/prod.\n-    rsa_private = M2Crypto.RSA.load_key(\n-        \"%s/%s.key\" % (ssldir, certname))\n+    rsa_private = M2Crypto.RSA.load_key(\"%s/%s.key\" % (ssldir, certname))","path":"fedmsg/crypto/x509.py","position":14,"original_position":14,"commit_id":"42c4812184cffabbeb41f43b9a9b8156756cda1f","original_commit_id":"42c4812184cffabbeb41f43b9a9b8156756cda1f","user":{"login":"bowlofeggs","id":354506,"avatar_url":"https://avatars.githubusercontent.com/u/354506?v=3","gravatar_id":"","url":"https://api.github.com/users/bowlofeggs","html_url":"https://github.com/bowlofeggs","followers_url":"https://api.github.com/users/bowlofeggs/followers","following_url":"https://api.github.com/users/bowlofeggs/following{/other_user}","gists_url":"https://api.github.com/users/bowlofeggs/gists{/gist_id}","starred_url":"https://api.github.com/users/bowlofeggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bowlofeggs/subscriptions","organizations_url":"https://api.github.com/users/bowlofeggs/orgs","repos_url":"https://api.github.com/users/bowlofeggs/repos","events_url":"https://api.github.com/users/bowlofeggs/events{/privacy}","received_events_url":"https://api.github.com/users/bowlofeggs/received_events","type":"User","site_admin":false},"body":"I recommend making this change in a separate commit since it is just formatting and is unrelated to the issue at hand.","created_at":"2016-11-11T17:48:35Z","updated_at":"2016-11-11T17:48:36Z","html_url":"https://github.com/fedora-infra/fedmsg/pull/389#discussion_r87628480","pull_request_url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389","_links":{"self":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/comments/87628480"},"html":{"href":"https://github.com/fedora-infra/fedmsg/pull/389#discussion_r87628480"},"pull_request":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389"}}},"pull_request":{"url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389","id":93198305,"html_url":"https://github.com/fedora-infra/fedmsg/pull/389","diff_url":"https://github.com/fedora-infra/fedmsg/pull/389.diff","patch_url":"https://github.com/fedora-infra/fedmsg/pull/389.patch","issue_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues/389","number":389,"state":"open","locked":false,"title":"Workaround odd change in M2Crypto==0.25.1","user":{"login":"ralphbean","id":331338,"avatar_url":"https://avatars.githubusercontent.com/u/331338?v=3","gravatar_id":"","url":"https://api.github.com/users/ralphbean","html_url":"https://github.com/ralphbean","followers_url":"https://api.github.com/users/ralphbean/followers","following_url":"https://api.github.com/users/ralphbean/following{/other_user}","gists_url":"https://api.github.com/users/ralphbean/gists{/gist_id}","starred_url":"https://api.github.com/users/ralphbean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralphbean/subscriptions","organizations_url":"https://api.github.com/users/ralphbean/orgs","repos_url":"https://api.github.com/users/ralphbean/repos","events_url":"https://api.github.com/users/ralphbean/events{/privacy}","received_events_url":"https://api.github.com/users/ralphbean/received_events","type":"User","site_admin":false},"body":"I verified with `tox` that our code worked fine on `M2Crypto==0.23.0`, but\nfailed on `M2Crypto==0.25.1`.  For some reason, the header information at the\nbeginning of our cert files trips up the latest version.  The code change here\nsimply strips out that header information before passing the actual encoded\ncertificate on to M2Crypto.","created_at":"2016-11-10T17:47:03Z","updated_at":"2016-11-11T17:48:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6a44883336d4c580270ed59f893a1bd0aaca08c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389/commits","review_comments_url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389/comments","review_comment_url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues/389/comments","statuses_url":"https://api.github.com/repos/fedora-infra/fedmsg/statuses/42c4812184cffabbeb41f43b9a9b8156756cda1f","head":{"label":"fedora-infra:feature/m2crypto25","ref":"feature/m2crypto25","sha":"42c4812184cffabbeb41f43b9a9b8156756cda1f","user":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"repo":{"id":3329386,"name":"fedmsg","full_name":"fedora-infra/fedmsg","owner":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedora-infra/fedmsg","description":"Federated Message Bus","fork":false,"url":"https://api.github.com/repos/fedora-infra/fedmsg","forks_url":"https://api.github.com/repos/fedora-infra/fedmsg/forks","keys_url":"https://api.github.com/repos/fedora-infra/fedmsg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedora-infra/fedmsg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedora-infra/fedmsg/teams","hooks_url":"https://api.github.com/repos/fedora-infra/fedmsg/hooks","issue_events_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues/events{/number}","events_url":"https://api.github.com/repos/fedora-infra/fedmsg/events","assignees_url":"https://api.github.com/repos/fedora-infra/fedmsg/assignees{/user}","branches_url":"https://api.github.com/repos/fedora-infra/fedmsg/branches{/branch}","tags_url":"https://api.github.com/repos/fedora-infra/fedmsg/tags","blobs_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedora-infra/fedmsg/statuses/{sha}","languages_url":"https://api.github.com/repos/fedora-infra/fedmsg/languages","stargazers_url":"https://api.github.com/repos/fedora-infra/fedmsg/stargazers","contributors_url":"https://api.github.com/repos/fedora-infra/fedmsg/contributors","subscribers_url":"https://api.github.com/repos/fedora-infra/fedmsg/subscribers","subscription_url":"https://api.github.com/repos/fedora-infra/fedmsg/subscription","commits_url":"https://api.github.com/repos/fedora-infra/fedmsg/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedora-infra/fedmsg/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedora-infra/fedmsg/contents/{+path}","compare_url":"https://api.github.com/repos/fedora-infra/fedmsg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedora-infra/fedmsg/merges","archive_url":"https://api.github.com/repos/fedora-infra/fedmsg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedora-infra/fedmsg/downloads","issues_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues{/number}","pulls_url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls{/number}","milestones_url":"https://api.github.com/repos/fedora-infra/fedmsg/milestones{/number}","notifications_url":"https://api.github.com/repos/fedora-infra/fedmsg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedora-infra/fedmsg/labels{/name}","releases_url":"https://api.github.com/repos/fedora-infra/fedmsg/releases{/id}","deployments_url":"https://api.github.com/repos/fedora-infra/fedmsg/deployments","created_at":"2012-02-01T21:50:18Z","updated_at":"2016-11-08T02:48:27Z","pushed_at":"2016-11-11T14:26:23Z","git_url":"git://github.com/fedora-infra/fedmsg.git","ssh_url":"git@github.com:fedora-infra/fedmsg.git","clone_url":"https://github.com/fedora-infra/fedmsg.git","svn_url":"https://github.com/fedora-infra/fedmsg","homepage":"http://fedmsg.com","size":2709,"stargazers_count":122,"watchers_count":122,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":24,"forks":77,"open_issues":24,"watchers":122,"default_branch":"develop"}},"base":{"label":"fedora-infra:develop","ref":"develop","sha":"2317846217b807edb22a6570c8ff333985c125ed","user":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"repo":{"id":3329386,"name":"fedmsg","full_name":"fedora-infra/fedmsg","owner":{"login":"fedora-infra","id":3316637,"avatar_url":"https://avatars.githubusercontent.com/u/3316637?v=3","gravatar_id":"","url":"https://api.github.com/users/fedora-infra","html_url":"https://github.com/fedora-infra","followers_url":"https://api.github.com/users/fedora-infra/followers","following_url":"https://api.github.com/users/fedora-infra/following{/other_user}","gists_url":"https://api.github.com/users/fedora-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/fedora-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedora-infra/subscriptions","organizations_url":"https://api.github.com/users/fedora-infra/orgs","repos_url":"https://api.github.com/users/fedora-infra/repos","events_url":"https://api.github.com/users/fedora-infra/events{/privacy}","received_events_url":"https://api.github.com/users/fedora-infra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedora-infra/fedmsg","description":"Federated Message Bus","fork":false,"url":"https://api.github.com/repos/fedora-infra/fedmsg","forks_url":"https://api.github.com/repos/fedora-infra/fedmsg/forks","keys_url":"https://api.github.com/repos/fedora-infra/fedmsg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedora-infra/fedmsg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedora-infra/fedmsg/teams","hooks_url":"https://api.github.com/repos/fedora-infra/fedmsg/hooks","issue_events_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues/events{/number}","events_url":"https://api.github.com/repos/fedora-infra/fedmsg/events","assignees_url":"https://api.github.com/repos/fedora-infra/fedmsg/assignees{/user}","branches_url":"https://api.github.com/repos/fedora-infra/fedmsg/branches{/branch}","tags_url":"https://api.github.com/repos/fedora-infra/fedmsg/tags","blobs_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedora-infra/fedmsg/statuses/{sha}","languages_url":"https://api.github.com/repos/fedora-infra/fedmsg/languages","stargazers_url":"https://api.github.com/repos/fedora-infra/fedmsg/stargazers","contributors_url":"https://api.github.com/repos/fedora-infra/fedmsg/contributors","subscribers_url":"https://api.github.com/repos/fedora-infra/fedmsg/subscribers","subscription_url":"https://api.github.com/repos/fedora-infra/fedmsg/subscription","commits_url":"https://api.github.com/repos/fedora-infra/fedmsg/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedora-infra/fedmsg/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedora-infra/fedmsg/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedora-infra/fedmsg/contents/{+path}","compare_url":"https://api.github.com/repos/fedora-infra/fedmsg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedora-infra/fedmsg/merges","archive_url":"https://api.github.com/repos/fedora-infra/fedmsg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedora-infra/fedmsg/downloads","issues_url":"https://api.github.com/repos/fedora-infra/fedmsg/issues{/number}","pulls_url":"https://api.github.com/repos/fedora-infra/fedmsg/pulls{/number}","milestones_url":"https://api.github.com/repos/fedora-infra/fedmsg/milestones{/number}","notifications_url":"https://api.github.com/repos/fedora-infra/fedmsg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedora-infra/fedmsg/labels{/name}","releases_url":"https://api.github.com/repos/fedora-infra/fedmsg/releases{/id}","deployments_url":"https://api.github.com/repos/fedora-infra/fedmsg/deployments","created_at":"2012-02-01T21:50:18Z","updated_at":"2016-11-08T02:48:27Z","pushed_at":"2016-11-11T14:26:23Z","git_url":"git://github.com/fedora-infra/fedmsg.git","ssh_url":"git@github.com:fedora-infra/fedmsg.git","clone_url":"https://github.com/fedora-infra/fedmsg.git","svn_url":"https://github.com/fedora-infra/fedmsg","homepage":"http://fedmsg.com","size":2709,"stargazers_count":122,"watchers_count":122,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":24,"forks":77,"open_issues":24,"watchers":122,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389"},"html":{"href":"https://github.com/fedora-infra/fedmsg/pull/389"},"issue":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/issues/389"},"comments":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/issues/389/comments"},"review_comments":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389/comments"},"review_comment":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/pulls/389/commits"},"statuses":{"href":"https://api.github.com/repos/fedora-infra/fedmsg/statuses/42c4812184cffabbeb41f43b9a9b8156756cda1f"}}}}
{"actor":{"display_login":"bowlofeggs"}}