← Back to issue list

snapcraft 8 tries to open certificate on host system at a non-standard path

View original Github issue

Metadata

Project
snapcraft
Number
#4527
Type
issue
State
closed
Author
valentindavid
Labels
Created
Updated
Closed

Current evaluation

Resolved in snapcraft 8.0.2 via PR #4526. The hardcoded SSL certificate path caused crashes on non-Debian distributions. The fix updates pygit2 to correctly locate certificates, preventing initialization failures on systems like Fedora.

Suggested action:

No scores available.

Issue body

### Bug Description snapcraft 8 crashes on distributions other than Debian or Ubuntu because it tries to load `/usr/lib/ssl/cert.pem` on host which is not present on other distributions. ### To Reproduce Install snapd and snapcraft on let's say Fedora. Run snapcraft. ### Environment Tested on GNOME OS and on Fedora 39. ### snapcraft.yaml ```shell Do not need one. ``` ### Relevant log output ```shell Traceback (most recent call last): File "/snap/snapcraft/10279/bin/snapcraft", line 5, in <module> from snapcraft.cli import run File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/cli.py", line 35, in <module> from snapcraft.remote import RemoteBuildError File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/remote/__init__.py", line 29, in <module> from .git import ( File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/snapcraft/remote/git.py", line 27, in <module> import pygit2 File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/__init__.py", line 275, in <module> settings = Settings() File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 55, in __init__ self._initialize_tls_certificate_locations() File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 61, in _initialize_tls_certificate_locations self.set_ssl_cert_locations( File "/var/lib/snapd/snap/snapcraft/10279/lib/python3.10/site-packages/pygit2/settings.py", line 191, in set_ssl_cert_locations option(_pygit2.GIT_OPT_SET_SSL_CERT_LOCATIONS, cert_file, cert_dir) _pygit2.GitError: OpenSSL error: failed to load certificates: error:00000000:lib(0)::reason(0) ``` ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Resolved in snapcraft 8.0.2 via PR #4526. The hardcoded SSL certificate path caused crashes on non-Debian distributions. The fix updates pygit2 to correctly locate certificates, preventing initialization failures on systems like Fedora.
qwen/qwen3.6-35b-a3b Resolved in snapcraft 8.0.2 via PR #4526. The hardcoded SSL certificate path causing crashes on non-Debian distributions was corrected to dynamically detect system certificate locations.
qwen/qwen3.6-35b-a3b Fixed in snapcraft 8.0.2 via PR #4526. The crash on non-Debian distributions caused by a hardcoded SSL certificate path has been resolved.
qwen3.6-35b-a3b-mtp-q6 Resolved in snapcraft 8.0.2 via PR #4526. The crash on non-Debian distributions caused by hardcoding the SSL certificate path was fixed by implementing dynamic path detection.
qwen3.6-35b-a3b-mtp-q6 Fixed in snapcraft 8.0.2 via PR #4526. The pygit2 crash on non-Debian/Ubuntu systems caused by a hardcoded SSL certificate path was resolved by updating certificate location handling.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#4510 snapcraft snap fails to launch snapcraft closed Fixed. The snapcraft snap launch failure caused by a pygit2 OpenSSL certificate error was resolved and released to the candidate channel.
77%