work in progress

This commit is contained in:
Lionel Dricot 2023-07-09 11:35:58 +02:00
parent 6d43b13520
commit a7c8ed33d5
1 changed files with 29 additions and 24 deletions

View File

@ -459,12 +459,15 @@ def _fetch_gemini(url):
context = ssl.SSLContext(protocol)
# Use CAs or TOFU
if self.options["tls_mode"] == "ca":
context.verify_mode = ssl.CERT_REQUIRED
context.check_hostname = True
context.load_default_certs()
else:
context.check_hostname = False
#TODO : should we care about this options?
#if self.options["tls_mode"] == "ca":
# context.verify_mode = ssl.CERT_REQUIRED
# context.check_hostname = True
# context.load_default_certs()
#else:
# context.check_hostname = False
# context.verify_mode = ssl.CERT_NONE
context.check_hostname=False
context.verify_mode = ssl.CERT_NONE
# Impose minimum TLS version
## In 3.7 and above, this is easy...
@ -483,6 +486,8 @@ def _fetch_gemini(url):
except ssl.SSLError:
# Rely on the server to only support sensible things, I guess...
pass
#TODO: Im here in the refactor
# Load client certificate if needed
if self.client_certs["active"]:
certfile, keyfile = self.client_certs["active"]