Skip to content

Commit

Permalink
Activate TLS ALPN extension
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3D3V committed Jul 4, 2024
1 parent f45a9c9 commit 73fdf71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion moodle_dl/moodle/moodle_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def extract_token(address: str) -> str:

splitted = decoded.split(':::')
if len(splitted) < 2:
logging.error('The token could not be decrypted. Did you perhaps not copy the complete url?')
logging.error('The token could not be decoded. Did you perhaps not copy the complete url?')
return None

token = re.sub(r'[^A-Za-z0-9]+', '', splitted[1])
Expand Down
3 changes: 3 additions & 0 deletions moodle_dl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,9 @@ def get_ssl_context(cls, skip_cert_verify: bool, allow_insecure_ssl: bool, use_a
if use_all_ciphers:
ssl_context.set_ciphers('ALL')

# Activate ALPN extension
ssl_context.set_alpn_protocols(['http/1.1'])

return ssl_context

class CustomHttpAdapter(requests.adapters.HTTPAdapter):
Expand Down
2 changes: 1 addition & 1 deletion moodle_dl/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.10'
__version__ = '2.3.11'

0 comments on commit 73fdf71

Please sign in to comment.