Skip to content

Commit 56d72af

Browse files
committed
cafile is deprecated apparently.
Just use the ssl module.
1 parent 8224381 commit 56d72af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sphinx_json_schema_spec/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import datetime
33
from pathlib import Path
44
from urllib.parse import urljoin
5+
import ssl
56
import urllib.request
67

78
try:
@@ -11,7 +12,6 @@
1112

1213
from docutils import nodes
1314
from lxml import html
14-
import certifi
1515

1616
BASE_URL = "https://json-schema.org/draft/2020-12/"
1717
VOCABULARIES = {
@@ -80,7 +80,8 @@ def fetch_or_load(cache_path, url):
8080
headers["If-Modified-Since"] = date
8181

8282
request = urllib.request.Request(url, headers=headers)
83-
response = urllib.request.urlopen(request, cafile=certifi.where())
83+
context = ssl.create_default_context()
84+
response = urllib.request.urlopen(request, context=context)
8485

8586
if response.code == 200:
8687
with cache_path.open("w+b") as out:

0 commit comments

Comments
 (0)