Summary: | lang/python27: SSL certificate verification error, Python not finding SSL pem file | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Tony Narlock <tony> | ||||
Component: | Individual Port(s) | Assignee: | Kubilay Kocak <koobs> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Many People | CC: | lukasz | ||||
Priority: | Normal | Keywords: | easy, regression | ||||
Version: | Latest | Flags: | koobs:
maintainer-feedback+
|
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Bug Depends on: | 196431 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Tony Narlock
2014-12-29 17:20:58 UTC
Auto-assigned to maintainer python@FreeBSD.org Thank you for the report Tony
>>> ssl.get_default_verify_paths()
DefaultVerifyPaths(cafile=None, capath=None, openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/etc/ssl/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/etc/ssl/certs')
Another workaround is to set environment variable SSL_CERT_FILE to /usr/local/etc/ssl/cert.pem
Blocking bug 196431 covers Ports OpenSSL Blocking bug 189811 covers Base OpenSSL Author: koobs Date: Mon Feb 9 09:44:29 UTC 2015 New revision: 378720 URL: https://svnweb.freebsd.org/changeset/ports/378720 Log: security/ca_root_nss: Fix SSL verification for ports OpenSSL consumers Since 2.7.9, Python verifies SSL certificates by default. Currently, even with security/ca_root_nss installed, Python fails certificate verification. Upon investigation, Python uses OpenSSL's standard SSL_CTX_load_verify_locations function to load a list of CA root certificates. Support was added to ca_root_nss for "out of the box" certificate verification for a number of base utilities in r372629 [1], but this did not include support for software that uses OpenSSL's SSL_CTX_load_verify_locations function. [1] https://svnweb.freebsd.org/changeset/ports/372629 OpenSSL defaults (at compile time) to the following paths and filenames for certificate and CAFile lookup: Base: SSL_CERT_DIR=/etc/ssl/certs SSL_CERT_FILE/etc/ssl/cert.pem Ports: SSL_CERT_DIR=/usr/local/openssl/certs SSL_CERT_FILE=/usr/local/openssl/cert.pem This change installs a symlink which points to the root certificate bundle in the location that OpenSSL from ports looks for them. This allows any and all software utilising SSL_CTX_load_verify_locations function to verify SSL certificates by default after installation of this package. Additionally, display a pkg-message to the user about the lack of warranty associated with these certificates. Note: This is *NOT* related to solving for SSL certificate verification for OpenSSL in Base, which is covered in bug 189811. While I'm here: - Add LICENSE - Use options helpers and OPTIONS_SUB - Fix typo in !!! message !!! PR: 196431 Submitted by: koobs Reviewed by: jbeich Approved by: maintainer timeout (1 month) Changes: head/security/ca_root_nss/Makefile head/security/ca_root_nss/files/pkg-message.in head/security/ca_root_nss/pkg-plist A commit references this bug: Author: koobs Date: Sat Jun 6 07:41:52 UTC 2015 New revision: 388657 URL: https://svnweb.freebsd.org/changeset/ports/388657 Log: security/ca_root_nss: Enable certificate verification (for Base OpenSSL) Enable the ETCSYMLINK option so that SSL certificate verification is enabled by default for OpenSSL in base. This change is the third in a set of changes [1][2] that improves the default configuration and behaviour of client software relying on OpenSSL for SSL/TLS and certificate verification. A symlink is installed which points to the root certificate bundle in the location that OpenSSL in base looks for them, as configured at build time [2]. This allows any and all software utilising SSL_CTX_load_verify_locations function to verify SSL certificates by default after installation of this package. [1] https://svnweb.freebsd.org/changeset/ports/372629 [2] https://svnweb.freebsd.org/changeset/ports/378720 PR: 189811 196357 Requested by: many Submitted by: dreamcat4 gmail com Approved by: maintainer timeout (>1 year) Changes: head/security/ca_root_nss/Makefile Bug 189811 has been resolved (but remains open for further changes) and no longer blocks this issue. After ports revision 388657 [1], Python will verify certificates both with OpenSSL from base *and* ports successfully, along with any other software that uses the same OpenSSL functions. [1] https://svnweb.freebsd.org/changeset/ports/388657 |