{"action":"created","comment":{"url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/comments/210050695","pull_request_review_id":146186512,"id":210050695,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDA1MDY5NQ==","diff_hunk":"@@ -73,7 +74,40 @@ func newTLSConnection(address string, pemCert string) (*tls.Conn, error) {\n \t\treturn nil, errp.New(\"Failed to append CA cert as trusted cert\")\n \t}\n \tconn, err := tls.Dial(\"tcp\", address, &tls.Config{\n-\t\tRootCAs: caCertPool,\n+\t\tRootCAs:            caCertPool,\n+\t\tInsecureSkipVerify: true, // Not actually skipping, we check the cert in VerifyPeerCertificate\n+\t\tVerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {\n+\t\t\t// Code copy/pasted and adapted from\n+\t\t\t// https://github.com/golang/go/blob/81555cb4f3521b53f9de4ce15f64b77cc9df61b9/src/crypto/tls/handshake_client.go#L327-L344, but adapted to skip the hostname verification.\n+\t\t\t// See https://github.com/golang/go/issues/21971#issuecomment-412836078.\n+\n+\t\t\t// If this is the first handshake on a connection, process and\n+\t\t\t// (optionally) verify the server's certificates.\n+\t\t\tcerts := make([]*x509.Certificate, len(rawCerts))\n+\t\t\tfor i, asn1Data := range rawCerts {\n+\t\t\t\tcert, err := x509.ParseCertificate(asn1Data)\n+\t\t\t\tif err != nil {\n+\t\t\t\t\treturn errp.New(\"tls: failed to parse certificate from server: \" + err.Error())","path":"backend/coins/btc/electrum/electrum.go","position":26,"original_position":26,"commit_id":"ad825bba888a6449854a4abfd89ae86c1effc21a","original_commit_id":"ad825bba888a6449854a4abfd89ae86c1effc21a","user":{"login":"benma","id":1225267,"node_id":"MDQ6VXNlcjEyMjUyNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/1225267?v=4","gravatar_id":"","url":"https://api.github.com/users/benma","html_url":"https://github.com/benma","followers_url":"https://api.github.com/users/benma/followers","following_url":"https://api.github.com/users/benma/following{/other_user}","gists_url":"https://api.github.com/users/benma/gists{/gist_id}","starred_url":"https://api.github.com/users/benma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benma/subscriptions","organizations_url":"https://api.github.com/users/benma/orgs","repos_url":"https://api.github.com/users/benma/repos","events_url":"https://api.github.com/users/benma/events{/privacy}","received_events_url":"https://api.github.com/users/benma/received_events","type":"User","site_admin":false},"body":"good point. `errp` technically wraps everything with a stacktrace, though I am not sure when/if it outputs the stack in an actual failure.","created_at":"2018-08-14T18:08:39Z","updated_at":"2018-08-14T18:08:39Z","html_url":"https://github.com/digitalbitbox/bitbox-wallet-app/pull/18#discussion_r210050695","pull_request_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/comments/210050695"},"html":{"href":"https://github.com/digitalbitbox/bitbox-wallet-app/pull/18#discussion_r210050695"},"pull_request":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18"}},"in_reply_to_id":210018104},"pull_request":{"url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18","id":208312488,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4MzEyNDg4","html_url":"https://github.com/digitalbitbox/bitbox-wallet-app/pull/18","diff_url":"https://github.com/digitalbitbox/bitbox-wallet-app/pull/18.diff","patch_url":"https://github.com/digitalbitbox/bitbox-wallet-app/pull/18.patch","issue_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues/18","number":18,"state":"open","locked":false,"title":"electrum: skip cert hostname verification","user":{"login":"benma","id":1225267,"node_id":"MDQ6VXNlcjEyMjUyNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/1225267?v=4","gravatar_id":"","url":"https://api.github.com/users/benma","html_url":"https://github.com/benma","followers_url":"https://api.github.com/users/benma/followers","following_url":"https://api.github.com/users/benma/following{/other_user}","gists_url":"https://api.github.com/users/benma/gists{/gist_id}","starred_url":"https://api.github.com/users/benma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benma/subscriptions","organizations_url":"https://api.github.com/users/benma/orgs","repos_url":"https://api.github.com/users/benma/repos","events_url":"https://api.github.com/users/benma/events{/privacy}","received_events_url":"https://api.github.com/users/benma/received_events","type":"User","site_admin":false},"body":"In the current setup, the cert is usually self signed, with a missing\r\nCommonName (many public electrum servers work like that). When\r\nconnecting a full node, the cert is downloaded and checked manually.","created_at":"2018-08-14T15:01:15Z","updated_at":"2018-08-14T18:08:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd6239b68309b769643fba526edfebacaa637f8d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18/commits","review_comments_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18/comments","review_comment_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues/18/comments","statuses_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/statuses/ad825bba888a6449854a4abfd89ae86c1effc21a","head":{"label":"benma:cert-hostname","ref":"cert-hostname","sha":"ad825bba888a6449854a4abfd89ae86c1effc21a","user":{"login":"benma","id":1225267,"node_id":"MDQ6VXNlcjEyMjUyNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/1225267?v=4","gravatar_id":"","url":"https://api.github.com/users/benma","html_url":"https://github.com/benma","followers_url":"https://api.github.com/users/benma/followers","following_url":"https://api.github.com/users/benma/following{/other_user}","gists_url":"https://api.github.com/users/benma/gists{/gist_id}","starred_url":"https://api.github.com/users/benma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benma/subscriptions","organizations_url":"https://api.github.com/users/benma/orgs","repos_url":"https://api.github.com/users/benma/repos","events_url":"https://api.github.com/users/benma/events{/privacy}","received_events_url":"https://api.github.com/users/benma/received_events","type":"User","site_admin":false},"repo":{"id":144732609,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ3MzI2MDk=","name":"bitbox-wallet-app","full_name":"benma/bitbox-wallet-app","owner":{"login":"benma","id":1225267,"node_id":"MDQ6VXNlcjEyMjUyNjc=","avatar_url":"https://avatars0.githubusercontent.com/u/1225267?v=4","gravatar_id":"","url":"https://api.github.com/users/benma","html_url":"https://github.com/benma","followers_url":"https://api.github.com/users/benma/followers","following_url":"https://api.github.com/users/benma/following{/other_user}","gists_url":"https://api.github.com/users/benma/gists{/gist_id}","starred_url":"https://api.github.com/users/benma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benma/subscriptions","organizations_url":"https://api.github.com/users/benma/orgs","repos_url":"https://api.github.com/users/benma/repos","events_url":"https://api.github.com/users/benma/events{/privacy}","received_events_url":"https://api.github.com/users/benma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benma/bitbox-wallet-app","description":null,"fork":true,"url":"https://api.github.com/repos/benma/bitbox-wallet-app","forks_url":"https://api.github.com/repos/benma/bitbox-wallet-app/forks","keys_url":"https://api.github.com/repos/benma/bitbox-wallet-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benma/bitbox-wallet-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benma/bitbox-wallet-app/teams","hooks_url":"https://api.github.com/repos/benma/bitbox-wallet-app/hooks","issue_events_url":"https://api.github.com/repos/benma/bitbox-wallet-app/issues/events{/number}","events_url":"https://api.github.com/repos/benma/bitbox-wallet-app/events","assignees_url":"https://api.github.com/repos/benma/bitbox-wallet-app/assignees{/user}","branches_url":"https://api.github.com/repos/benma/bitbox-wallet-app/branches{/branch}","tags_url":"https://api.github.com/repos/benma/bitbox-wallet-app/tags","blobs_url":"https://api.github.com/repos/benma/bitbox-wallet-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benma/bitbox-wallet-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benma/bitbox-wallet-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/benma/bitbox-wallet-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benma/bitbox-wallet-app/statuses/{sha}","languages_url":"https://api.github.com/repos/benma/bitbox-wallet-app/languages","stargazers_url":"https://api.github.com/repos/benma/bitbox-wallet-app/stargazers","contributors_url":"https://api.github.com/repos/benma/bitbox-wallet-app/contributors","subscribers_url":"https://api.github.com/repos/benma/bitbox-wallet-app/subscribers","subscription_url":"https://api.github.com/repos/benma/bitbox-wallet-app/subscription","commits_url":"https://api.github.com/repos/benma/bitbox-wallet-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/benma/bitbox-wallet-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/benma/bitbox-wallet-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/benma/bitbox-wallet-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/benma/bitbox-wallet-app/contents/{+path}","compare_url":"https://api.github.com/repos/benma/bitbox-wallet-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benma/bitbox-wallet-app/merges","archive_url":"https://api.github.com/repos/benma/bitbox-wallet-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benma/bitbox-wallet-app/downloads","issues_url":"https://api.github.com/repos/benma/bitbox-wallet-app/issues{/number}","pulls_url":"https://api.github.com/repos/benma/bitbox-wallet-app/pulls{/number}","milestones_url":"https://api.github.com/repos/benma/bitbox-wallet-app/milestones{/number}","notifications_url":"https://api.github.com/repos/benma/bitbox-wallet-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benma/bitbox-wallet-app/labels{/name}","releases_url":"https://api.github.com/repos/benma/bitbox-wallet-app/releases{/id}","deployments_url":"https://api.github.com/repos/benma/bitbox-wallet-app/deployments","created_at":"2018-08-14T14:37:10Z","updated_at":"2018-08-14T14:37:13Z","pushed_at":"2018-08-14T15:00:39Z","git_url":"git://github.com/benma/bitbox-wallet-app.git","ssh_url":"git@github.com:benma/bitbox-wallet-app.git","clone_url":"https://github.com/benma/bitbox-wallet-app.git","svn_url":"https://github.com/benma/bitbox-wallet-app","homepage":"https://shiftcrypto.ch","size":9930,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"digitalbitbox:master","ref":"master","sha":"ed6c6a435e544fc1370cb02af2453ecae0c94343","user":{"login":"digitalbitbox","id":12703801,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzAzODAx","avatar_url":"https://avatars3.githubusercontent.com/u/12703801?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalbitbox","html_url":"https://github.com/digitalbitbox","followers_url":"https://api.github.com/users/digitalbitbox/followers","following_url":"https://api.github.com/users/digitalbitbox/following{/other_user}","gists_url":"https://api.github.com/users/digitalbitbox/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbitbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbitbox/subscriptions","organizations_url":"https://api.github.com/users/digitalbitbox/orgs","repos_url":"https://api.github.com/users/digitalbitbox/repos","events_url":"https://api.github.com/users/digitalbitbox/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbitbox/received_events","type":"Organization","site_admin":false},"repo":{"id":143284695,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMyODQ2OTU=","name":"bitbox-wallet-app","full_name":"digitalbitbox/bitbox-wallet-app","owner":{"login":"digitalbitbox","id":12703801,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzAzODAx","avatar_url":"https://avatars3.githubusercontent.com/u/12703801?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalbitbox","html_url":"https://github.com/digitalbitbox","followers_url":"https://api.github.com/users/digitalbitbox/followers","following_url":"https://api.github.com/users/digitalbitbox/following{/other_user}","gists_url":"https://api.github.com/users/digitalbitbox/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbitbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbitbox/subscriptions","organizations_url":"https://api.github.com/users/digitalbitbox/orgs","repos_url":"https://api.github.com/users/digitalbitbox/repos","events_url":"https://api.github.com/users/digitalbitbox/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbitbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/digitalbitbox/bitbox-wallet-app","description":null,"fork":false,"url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app","forks_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/forks","keys_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/teams","hooks_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/hooks","issue_events_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues/events{/number}","events_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/events","assignees_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/assignees{/user}","branches_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/branches{/branch}","tags_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/tags","blobs_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/statuses/{sha}","languages_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/languages","stargazers_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/stargazers","contributors_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/contributors","subscribers_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/subscribers","subscription_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/subscription","commits_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/contents/{+path}","compare_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/merges","archive_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/downloads","issues_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues{/number}","pulls_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls{/number}","milestones_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/milestones{/number}","notifications_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/labels{/name}","releases_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/releases{/id}","deployments_url":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/deployments","created_at":"2018-08-02T11:17:59Z","updated_at":"2018-08-14T15:07:08Z","pushed_at":"2018-08-14T15:07:06Z","git_url":"git://github.com/digitalbitbox/bitbox-wallet-app.git","ssh_url":"git@github.com:digitalbitbox/bitbox-wallet-app.git","clone_url":"https://github.com/digitalbitbox/bitbox-wallet-app.git","svn_url":"https://github.com/digitalbitbox/bitbox-wallet-app","homepage":"https://shiftcrypto.ch","size":9929,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":8,"open_issues":12,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18"},"html":{"href":"https://github.com/digitalbitbox/bitbox-wallet-app/pull/18"},"issue":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues/18"},"comments":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/digitalbitbox/bitbox-wallet-app/statuses/ad825bba888a6449854a4abfd89ae86c1effc21a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"benma"}}