WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] HTTPS (SSL) support (10 posts)

  1. mcantsin
    Member
    Posted 2 years ago #

    Hi

    Could you please add https support for this plugin?

    Tnks & kind rgrds, MC

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Hi MC,

    WP-Piwik normally should work with SSL as well:

    - The tracking code chooses the protocol used by the visitor automatically.
    - The API calls are done using your entered URL.
    - The API calls use fopen or cURL. Both should support SSL. The certificate is trustable? See http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/

    Maybe I overlook a fault? Please give me an example.

    Best regards
    André

  3. mcantsin
    Member
    Posted 2 years ago #

    Hi André

    Thanks for your message.
    Yes, indeed. I am using CAcert[0] certificates, which were, surprisingly, disabled in the file containing the list of trusted certificates on the GNU/Linux Debian host.
    /etc/ca-certificates.conf

    So I reenabled the respective certificates and updated the certificates list.
    update-ca-certificates --fresh

    After this wp-piwik accepted the https host.

    As you were saying, the following quick fix in wp-piwik.php also does the job.
    curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);

    Thanks for your advice and kind regards, MC

    [0] http://cacert.org

  4. kleinermann
    Member
    Posted 2 years ago #

    I have added the line, and now it works for me:

    curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);

    But i have to add the line again with every update of the module. Isn't there a better way to fix this issue?

    Also, since i added the line, i get another error:
    An error occured: The method 'getPiwikVersion' does not exist or is not available in the module 'Piwik_API_API'. [Support]

  5. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    1. You can fix this issue by using a valid certificate or by adding your certificate to your configuration as described above by mcantsin.

    I thought about some kind of "don't verify SSL certs" option, but I'm not happy on adding a feature which means "use a SSL certificate, but don't care about its validity". It would lead the SSL idea ad absurdum, wouldn't it?

    2. Please update your Piwik to the latest version. WP-Piwik requires at least Piwik 1.8.2.

  6. mcnesium
    Member
    Posted 2 years ago #

    mcnesium:~$ sudo dpkg-reconfigure ca-certificates
    Updating certificates in /etc/ssl/certs....done.
    mcnesium:~$ sudo update-ca-certificates --fresh
    Clearing symlinks in /etc/ssl/certs...done.
    Updating certificates in /etc/ssl/certs....done.
    mcnesium:~$ ll /etc/ssl/certs/ | grep cacert.org
    lrwxrwxrwx 1 root root 48 2012-08-25 18:53 class3.pem -> /usr/share/ca-certificates/cacert.org/class3.crt
    lrwxrwxrwx 1 root root 46 2012-08-25 18:53 root.pem -> /usr/share/ca-certificates/cacert.org/root.crt

    still not working with my setup. whenever i change the piwik url (rest api) from http to https i get a php error at the top

    Warning: implode() [function.implode]: Bad arguments. in /.../wp-piwik.php on line 438

    and at the bottom it says

    An error occured: Please check URL and auth token. You need at least view access to one site. [Support]

    the token works fine with http. i currently use both the latest versions wp 3.4.1 and wp-piwik 0.9.5

  7. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Can you try to add curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); to WP-Piwik as explained above?

  8. mj2
    Member
    Posted 2 years ago #

    Hi,I'm having trouble getting this plugin to work as well.

    Have a self signed ssl certificate because I just use the domain where piwik is installed for stats only. No need to purchase certificate just for myself. So trying to use ssl, with this wordpress plugin, and keep getting this error message

    n error occured: Please check URL and auth token. You need at least view access to one site. [Support]

    1. Piwik installed using self signed ssl certificate on separate domain from where my wordpress site is installed

    2. I've tried adding the line
    curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);

    to wp-piwik php plugin but then I get site errors so the site won't display properly.

    Where exactly should the curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);

    be placed in the wp-piwik.php file?

    3. sure wish that this was a bit easier for those of us using ssl who don't want to purchase a certificate just to run stats.

    Thanks for the help and for the plugin...just hoping I can get it to work.

  9. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Hi mj2,

    try to add the curl_setopt line behind $c = curl_init($strURL);

    Are you sure your setup supports cURL? Maybe you are connecting via fopen?

    The next release contains an option to set this curl option (and a similar fopen option) via settings.

  10. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Note: "Disable SSL peer verification" option added in 0.9.6. The update will be released within the next few days.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags