Spaces:
Runtime error
Runtime error
Try to make HTTPS works again
Browse files
server.py
CHANGED
@@ -2,7 +2,16 @@ import copy
|
|
2 |
import glob
|
3 |
import json
|
4 |
import os
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
import hashlib
|
7 |
import time
|
8 |
import requests
|
|
|
2 |
import glob
|
3 |
import json
|
4 |
import os
|
5 |
+
# Necessary for `requests`. Without set correct path or empty string it fails during process HTTPS connection with this: [Errno 101] Network is unreachable
|
6 |
+
if os.path.exists("/etc/ssl/certs/ca-certificates.crt"):
|
7 |
+
os.environ["CURL_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt"
|
8 |
+
os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt"
|
9 |
+
else:
|
10 |
+
os.environ["CURL_CA_BUNDLE"] = ""
|
11 |
+
os.environ["REQUESTS_CA_BUNDLE"] = ""
|
12 |
+
print(f"{os.environ.get('CURL_CA_BUNDLE') = }")
|
13 |
+
print(f"{os.environ.get('REQUESTS_CA_BUNDLE') = }")
|
14 |
+
|
15 |
import hashlib
|
16 |
import time
|
17 |
import requests
|