{"action":"closed","number":7,"pull_request":{"url":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/7","id":30618804,"html_url":"https://github.com/piwik/piwik-php-tracker/pull/7","diff_url":"https://github.com/piwik/piwik-php-tracker/pull/7.diff","patch_url":"https://github.com/piwik/piwik-php-tracker/pull/7.patch","issue_url":"https://api.github.com/repos/piwik/piwik-php-tracker/issues/7","number":7,"state":"closed","locked":false,"title":"Allow setting SSL certificate for secure curl","user":{"login":"leighmarble","id":422876,"avatar_url":"https://avatars.githubusercontent.com/u/422876?v=3","gravatar_id":"","url":"https://api.github.com/users/leighmarble","html_url":"https://github.com/leighmarble","followers_url":"https://api.github.com/users/leighmarble/followers","following_url":"https://api.github.com/users/leighmarble/following{/other_user}","gists_url":"https://api.github.com/users/leighmarble/gists{/gist_id}","starred_url":"https://api.github.com/users/leighmarble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighmarble/subscriptions","organizations_url":"https://api.github.com/users/leighmarble/orgs","repos_url":"https://api.github.com/users/leighmarble/repos","events_url":"https://api.github.com/users/leighmarble/events{/privacy}","received_events_url":"https://api.github.com/users/leighmarble/received_events","type":"User","site_admin":false},"body":"This took me hours to figure out why my tracking script wouldn't connect sucessfully with my Piwik installation. Both my PHP script and Piwik were on the same server, which has an SSL certificate set up. So, I was setting PiwikTracker's Piwik base URL (class static variable `$URL`) as `https://www.mysitecom/piwik`.\r\n\r\nAnd the tracking script wasn't working. If I changed `$URL` to `http://www.mysitecom/piwik`, however, it WOULD work.\r\n\r\nTroubleshooting with curl on the command line with `curl https://www.mysitecom/piwik` showed me a useful error:\r\n\r\n`curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:\r\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed`\r\n\r\nThese links helped me figure out what was going on, and how to fix it:\r\nhttp://stackoverflow.com/questions/6400300/https-and-ssl3-get-server-certificatecertificate-verify-failed-ca-is-ok\r\nhttp://curl.haxx.se/docs/sslcerts.html\r\nhttp://php.net/manual/en/function.curl-setopt.php\r\nhttp://curl.haxx.se/ca/cacert.pem\r\n\r\nI am submitting my proposed changes as a pull request, as there may be a more graceful way to do this. But whichever way it is done, for using PiwikTracker in shared hosting environments (in my case, Dreamhost), it would seem essential to allow some method setting a path to certificates as run time.\r\n\r\nIn this solution, I set the `PATH_TO_CERTIFICATES_FILE` constant from my tracking script before I instantiate the PiwikTracker class. However, the authors may wish to instead use a class variable and an associated setter method instead.","created_at":"2015-03-06T03:37:34Z","updated_at":"2015-03-16T05:18:59Z","closed_at":"2015-03-16T05:18:58Z","merged_at":"2015-03-16T05:18:58Z","merge_commit_sha":"8e14e67408468b5e537be260d7c96dbf74e416aa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/7/commits","review_comments_url":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/7/comments","review_comment_url":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/piwik/piwik-php-tracker/issues/7/comments","statuses_url":"https://api.github.com/repos/piwik/piwik-php-tracker/statuses/1a61644976545b55188df5311a7c3be145e40945","head":{"label":"leighmarble:master","ref":"master","sha":"1a61644976545b55188df5311a7c3be145e40945","user":{"login":"leighmarble","id":422876,"avatar_url":"https://avatars.githubusercontent.com/u/422876?v=3","gravatar_id":"","url":"https://api.github.com/users/leighmarble","html_url":"https://github.com/leighmarble","followers_url":"https://api.github.com/users/leighmarble/followers","following_url":"https://api.github.com/users/leighmarble/following{/other_user}","gists_url":"https://api.github.com/users/leighmarble/gists{/gist_id}","starred_url":"https://api.github.com/users/leighmarble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighmarble/subscriptions","organizations_url":"https://api.github.com/users/leighmarble/orgs","repos_url":"https://api.github.com/users/leighmarble/repos","events_url":"https://api.github.com/users/leighmarble/events{/privacy}","received_events_url":"https://api.github.com/users/leighmarble/received_events","type":"User","site_admin":false},"repo":{"id":31735153,"name":"piwik-php-tracker","full_name":"leighmarble/piwik-php-tracker","owner":{"login":"leighmarble","id":422876,"avatar_url":"https://avatars.githubusercontent.com/u/422876?v=3","gravatar_id":"","url":"https://api.github.com/users/leighmarble","html_url":"https://github.com/leighmarble","followers_url":"https://api.github.com/users/leighmarble/followers","following_url":"https://api.github.com/users/leighmarble/following{/other_user}","gists_url":"https://api.github.com/users/leighmarble/gists{/gist_id}","starred_url":"https://api.github.com/users/leighmarble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighmarble/subscriptions","organizations_url":"https://api.github.com/users/leighmarble/orgs","repos_url":"https://api.github.com/users/leighmarble/repos","events_url":"https://api.github.com/users/leighmarble/events{/privacy}","received_events_url":"https://api.github.com/users/leighmarble/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leighmarble/piwik-php-tracker","description":"PHP Client for Piwik Analytics Tracking API","fork":true,"url":"https://api.github.com/repos/leighmarble/piwik-php-tracker","forks_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/forks","keys_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/teams","hooks_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/hooks","issue_events_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/issues/events{/number}","events_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/events","assignees_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/assignees{/user}","branches_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/branches{/branch}","tags_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/tags","blobs_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/languages","stargazers_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/stargazers","contributors_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/contributors","subscribers_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/subscribers","subscription_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/subscription","commits_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/contents/{+path}","compare_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/merges","archive_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/downloads","issues_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/issues{/number}","pulls_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/labels{/name}","releases_url":"https://api.github.com/repos/leighmarble/piwik-php-tracker/releases{/id}","created_at":"2015-03-05T20:39:59Z","updated_at":"2015-03-06T00:30:47Z","pushed_at":"2015-03-06T00:30:47Z","git_url":"git://github.com/leighmarble/piwik-php-tracker.git","ssh_url":"git@github.com:leighmarble/piwik-php-tracker.git","clone_url":"https://github.com/leighmarble/piwik-php-tracker.git","svn_url":"https://github.com/leighmarble/piwik-php-tracker","homepage":null,"size":135,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":0,"default_branch":"master"}},"base":{"label":"piwik:master","ref":"master","sha":"be8e96bdfcbc6360729de449b4a9d2c93d997919","user":{"login":"piwik","id":698038,"avatar_url":"https://avatars.githubusercontent.com/u/698038?v=3","gravatar_id":"","url":"https://api.github.com/users/piwik","html_url":"https://github.com/piwik","followers_url":"https://api.github.com/users/piwik/followers","following_url":"https://api.github.com/users/piwik/following{/other_user}","gists_url":"https://api.github.com/users/piwik/gists{/gist_id}","starred_url":"https://api.github.com/users/piwik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piwik/subscriptions","organizations_url":"https://api.github.com/users/piwik/orgs","repos_url":"https://api.github.com/users/piwik/repos","events_url":"https://api.github.com/users/piwik/events{/privacy}","received_events_url":"https://api.github.com/users/piwik/received_events","type":"Organization","site_admin":false},"repo":{"id":21182913,"name":"piwik-php-tracker","full_name":"piwik/piwik-php-tracker","owner":{"login":"piwik","id":698038,"avatar_url":"https://avatars.githubusercontent.com/u/698038?v=3","gravatar_id":"","url":"https://api.github.com/users/piwik","html_url":"https://github.com/piwik","followers_url":"https://api.github.com/users/piwik/followers","following_url":"https://api.github.com/users/piwik/following{/other_user}","gists_url":"https://api.github.com/users/piwik/gists{/gist_id}","starred_url":"https://api.github.com/users/piwik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piwik/subscriptions","organizations_url":"https://api.github.com/users/piwik/orgs","repos_url":"https://api.github.com/users/piwik/repos","events_url":"https://api.github.com/users/piwik/events{/privacy}","received_events_url":"https://api.github.com/users/piwik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/piwik/piwik-php-tracker","description":"PHP Client for Piwik Analytics Tracking API","fork":false,"url":"https://api.github.com/repos/piwik/piwik-php-tracker","forks_url":"https://api.github.com/repos/piwik/piwik-php-tracker/forks","keys_url":"https://api.github.com/repos/piwik/piwik-php-tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piwik/piwik-php-tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piwik/piwik-php-tracker/teams","hooks_url":"https://api.github.com/repos/piwik/piwik-php-tracker/hooks","issue_events_url":"https://api.github.com/repos/piwik/piwik-php-tracker/issues/events{/number}","events_url":"https://api.github.com/repos/piwik/piwik-php-tracker/events","assignees_url":"https://api.github.com/repos/piwik/piwik-php-tracker/assignees{/user}","branches_url":"https://api.github.com/repos/piwik/piwik-php-tracker/branches{/branch}","tags_url":"https://api.github.com/repos/piwik/piwik-php-tracker/tags","blobs_url":"https://api.github.com/repos/piwik/piwik-php-tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piwik/piwik-php-tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piwik/piwik-php-tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/piwik/piwik-php-tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piwik/piwik-php-tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/piwik/piwik-php-tracker/languages","stargazers_url":"https://api.github.com/repos/piwik/piwik-php-tracker/stargazers","contributors_url":"https://api.github.com/repos/piwik/piwik-php-tracker/contributors","subscribers_url":"https://api.github.com/repos/piwik/piwik-php-tracker/subscribers","subscription_url":"https://api.github.com/repos/piwik/piwik-php-tracker/subscription","commits_url":"https://api.github.com/repos/piwik/piwik-php-tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/piwik/piwik-php-tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/piwik/piwik-php-tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/piwik/piwik-php-tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/piwik/piwik-php-tracker/contents/{+path}","compare_url":"https://api.github.com/repos/piwik/piwik-php-tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piwik/piwik-php-tracker/merges","archive_url":"https://api.github.com/repos/piwik/piwik-php-tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piwik/piwik-php-tracker/downloads","issues_url":"https://api.github.com/repos/piwik/piwik-php-tracker/issues{/number}","pulls_url":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/piwik/piwik-php-tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/piwik/piwik-php-tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piwik/piwik-php-tracker/labels{/name}","releases_url":"https://api.github.com/repos/piwik/piwik-php-tracker/releases{/id}","created_at":"2014-06-24T22:31:52Z","updated_at":"2015-03-14T22:45:16Z","pushed_at":"2015-03-16T05:18:58Z","git_url":"git://github.com/piwik/piwik-php-tracker.git","ssh_url":"git@github.com:piwik/piwik-php-tracker.git","clone_url":"https://github.com/piwik/piwik-php-tracker.git","svn_url":"https://github.com/piwik/piwik-php-tracker","homepage":null,"size":362,"stargazers_count":15,"watchers_count":15,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/7"},"html":{"href":"https://github.com/piwik/piwik-php-tracker/pull/7"},"issue":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/issues/7"},"comments":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/piwik/piwik-php-tracker/statuses/1a61644976545b55188df5311a7c3be145e40945"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"comments":7,"review_comments":0,"commits":2,"additions":2,"deletions":0,"changed_files":1}}