Linux: SSL/HTTPS Request Unable to Get Local Issuer Certificate #102300

Closed
opened 2022-11-06 02:48:24 +01:00 by Anthony Russo · 13 comments

System Information
Operating system: Linux-5.15.0-52-generic-x86_64-with-glibc2.35 64 Bits (Ubuntu 22.04.1)
Graphics card: SVGA3D; build: RELEASE; LLVM; VMware, Inc. 4.1 (Core Profile) Mesa 22.0.5

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a9
Worked: version: 2.79b, date: 2018-03-22 14:10, hash: f4dc9f9d68b

Short description of error
HTTPS requests made via urllib always result in urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
Cert paths point to locations that do not exist on the machine and seem to be specific to the build environment: /home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/ssl/certs
Whereas I'd expect it to be /usr/lib/ssl/certs which is the case in version 2.79b and in a separate python 3.10 interpreter.

Exact steps for others to reproduce the error
To view cert paths:

import ssl
ssl.get_default_verify_paths()

To make HTTPS request:

from urllib import request
request.urlopen('https://blender.org').status
**System Information** Operating system: Linux-5.15.0-52-generic-x86_64-with-glibc2.35 64 Bits (Ubuntu 22.04.1) Graphics card: SVGA3D; build: RELEASE; LLVM; VMware, Inc. 4.1 (Core Profile) Mesa 22.0.5 **Blender Version** Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: `b292cfe5a9` Worked: version: 2.79b, date: 2018-03-22 14:10, hash: `f4dc9f9d68b` **Short description of error** HTTPS requests made via urllib always result in `urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>` Cert paths point to locations that do not exist on the machine and seem to be specific to the build environment: `/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/ssl/certs` Whereas I'd expect it to be `/usr/lib/ssl/certs` which is the case in version 2.79b and in a separate python 3.10 interpreter. **Exact steps for others to reproduce the error** To view cert paths: ``` import ssl ssl.get_default_verify_paths() ``` To make HTTPS request: ``` from urllib import request request.urlopen('https://blender.org').status ```
Author

Added subscriber: @NullSenseStudio

Added subscriber: @NullSenseStudio
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscribers: @ideasman42, @brecht

Added subscribers: @ideasman42, @brecht

CC @campbellbarton.

CC @campbellbarton.
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

it seems to referencing a local path to the build VM, it works if i manually copy 3.4/python/lib/python3.10/site-packages/certifi/cacert.pem to /root/blender-git/build_linux/deps/Release/ssl/cert.pem

it seems to referencing a local path to the build VM, it works if i manually copy `3.4/python/lib/python3.10/site-packages/certifi/cacert.pem` to `/root/blender-git/build_linux/deps/Release/ssl/cert.pem`
Member

for 3.5 we do have a usercustomize.py I think if we set the env vars there to point to certifi's bundle (if the vars are not set to a valid file already) we'll be ok

for 3.5 we do have a `usercustomize.py` I think if we set the env vars there to point to certifi's bundle (if the vars are not set to a valid file already) we'll be ok

We bundle the requests package, which I guess works and is what most Blender add-ons rely on. So the workaround would be using that instead of urllib.

@LazyDodo I wonder how it's handled on Windows and macOS. If they use system certificates in this case also, it may make sense to use /usr/lib/ssl/certs on Linux.

We bundle the `requests` package, which I guess works and is what most Blender add-ons rely on. So the workaround would be using that instead of `urllib`. @LazyDodo I wonder how it's handled on Windows and macOS. If they use system certificates in this case also, it may make sense to use `/usr/lib/ssl/certs` on Linux.
Member

windows: it tries to load C:\Program Files\Common Files\SSL\cert.pem which will in most cases fail, then falls back on the windows certificate store (for py 3.4+)
mac: no idea

windows: it tries to load `C:\Program Files\Common Files\SSL\cert.pem` which will in most cases fail, then falls back on the windows certificate store (for py 3.4+) mac: no idea

Maybe pointing to /usr/lib/ssl/certs would be more consistent between platforms then, using system certs.

Maybe pointing to `/usr/lib/ssl/certs` would be more consistent between platforms then, using system certs.
Philipp Oeser removed the
Interest
Platforms, Builds & Tests
label 2023-02-10 08:58:22 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-10-17 11:05:26 +02:00

The issue still appears to be present in latest Blender 4.0 beta build (from November 3, 937b12e983). Reproducing it on Fedora 38.

The issue still appears to be present in latest Blender 4.0 beta build (from November 3, 937b12e9830a). Reproducing it on Fedora 38.

@alexkowel1 even if it's the same kind of issue, the issue your running into will need it's own follow up, could you open a new report with the result of:

import ssl
print(ssl.get_default_verify_paths())
import urllib
from urllib import request
print(request.urlopen('https://blender.org').status)
import os
print(os.environ.get("SSL_CERT_FILE"))
@alexkowel1 even if it's the same kind of issue, the issue your running into will need it's own follow up, could you open a new report with the result of: ``` import ssl print(ssl.get_default_verify_paths()) ``` ``` import urllib from urllib import request print(request.urlopen('https://blender.org').status) ``` ``` import os print(os.environ.get("SSL_CERT_FILE")) ```

Done, see #114452

Done, see https://projects.blender.org/blender/blender/issues/114452
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#102300
No description provided.