Skip to content

Piwik & self signed certificates : urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed. Add new --accept-invalid-ssl-certificate #138

@Daryes

Description

@Daryes

Hello,
This happens when using a self signed ssl certificate on a https hosted Piwik.
It doesn't happen when falling back to http or downgrading python, something already referenced in #42 .
Of course, it's not possible to import any logs with this

2016-05-11 19:10:58,171: [INFO] Error when connecting to Piwik: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
2016-05-11 19:10:58,171: [INFO] Max number of attempts reached, server is unreachable!
Traceback (most recent call last):
File "piwik/misc/log-analytics/import_logs.py", line 2338, in
resolver = config.get_resolver()
File "piwik/misc/log-analytics/import_logs.py", line 972, in get_resolver
return StaticResolver(self.options.site_id)
File "piwik/misc/log-analytics/import_logs.py", line 1383, in init
'SitesManager.getSiteFromId', idSite=self.site_id
File "piwik/misc/log-analytics/import_logs.py", line 1366, in call_api
return cls._call_wrapper(cls._call_api, None, None, method, **kwargs)
File "piwik/misc/log-analytics/import_logs.py", line 1353, in _call_wrapper
raise Piwik.Error(message, code)
main.Error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

A bug I didn't experienced before upgrading the system and thus, doing the same with python jumping to v2.7.11. As expected, since Python had a change in v2.7.9+, making mandatory the certificate validation, which wasn't the case before.
Redhat compiled some workarounds on this page, most of them working on a global level.

I've attached a dedicated workaround patch for the log-analytics I've done after searching around a lot, but I'm no python dev, it would be helpfull to add the whole mechanic for a --no-ssl-validity-check or similar parameter

SSL-workaround.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions