mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-22 09:19:55 +06:00
Force plugin to use TLS v1.2 instead of v1.3.
This is needed due to a change on Adobe's end, breaking Python > 3.7.16. Fixes #105.
This commit is contained in:
parent
6c29c42581
commit
2dcf26be18
@ -294,7 +294,13 @@ def sendHTTPRequest_getSimple(URL):
|
||||
# It appears as if lots of book distributors have either invalid or expired certs ...
|
||||
# No idea how Adobe handles that (pinning?), but we can just ignore SSL errors and continue anyways.
|
||||
# Not the best solution, but it works.
|
||||
ctx = ssl.create_default_context()
|
||||
try:
|
||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
||||
# This is needed due to an Adobe change.
|
||||
# Without this, only Python <= 3.7.16 can connect, 3.7.17 and above fail.
|
||||
except:
|
||||
ctx = ssl.create_default_context()
|
||||
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
@ -328,7 +334,13 @@ def sendPOSTHTTPRequest(URL, document, type, returnRC = False):
|
||||
# It appears as if lots of book distributors have either invalid or expired certs ...
|
||||
# No idea how Adobe handles that (pinning?), but we can just ignore SSL errors and continue anyways.
|
||||
# Not the best solution, but it works.
|
||||
ctx = ssl.create_default_context()
|
||||
try:
|
||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
||||
# This is needed due to an Adobe change.
|
||||
# Without this, only Python <= 3.7.16 can connect, 3.7.17 and above fail.
|
||||
except:
|
||||
ctx = ssl.create_default_context()
|
||||
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user