Fix TLS verification for ComicsKingdom
It seems they can make the same error multiple times (see #132), so we are explicit on which certificate we trust now (fixes #204).
This commit is contained in:
parent
e832c8e93b
commit
5ee888d889
3 changed files with 73 additions and 4 deletions
51
dosagelib/data/godaddy-bundle-g2-2031.pem
Normal file
51
dosagelib/data/godaddy-bundle-g2-2031.pem
Normal file
|
@ -0,0 +1,51 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIE0DCCA7igAwIBAgIBBzANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
|
||||
EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT
|
||||
EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp
|
||||
ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTExMDUwMzA3MDAwMFoXDTMxMDUwMzA3
|
||||
MDAwMFowgbQxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH
|
||||
EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjEtMCsGA1UE
|
||||
CxMkaHR0cDovL2NlcnRzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkvMTMwMQYDVQQD
|
||||
EypHbyBEYWRkeSBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIwggEi
|
||||
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC54MsQ1K92vdSTYuswZLiBCGzD
|
||||
BNliF44v/z5lz4/OYuY8UhzaFkVLVat4a2ODYpDOD2lsmcgaFItMzEUz6ojcnqOv
|
||||
K/6AYZ15V8TPLvQ/MDxdR/yaFrzDN5ZBUY4RS1T4KL7QjL7wMDge87Am+GZHY23e
|
||||
cSZHjzhHU9FGHbTj3ADqRay9vHHZqm8A29vNMDp5T19MR/gd71vCxJ1gO7GyQ5HY
|
||||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eE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr
|
||||
gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo
|
||||
2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
|
||||
LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI
|
||||
4uJEvlz36hz1
|
||||
-----END CERTIFICATE-----
|
|
@ -1,10 +1,17 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (C) 2019 Tobias Gruetzmacher
|
||||
# Copyright (C) 2019-2022 Tobias Gruetzmacher
|
||||
# Copyright (C) 2019 Thomas W. Littauer
|
||||
import re
|
||||
|
||||
try:
|
||||
from functools import cached_property
|
||||
except ImportError:
|
||||
from cached_property import cached_property
|
||||
from importlib.resources import path as get_path
|
||||
|
||||
from ..scraper import _BasicScraper
|
||||
from ..helpers import bounceStarter, joinPathPartsNamer
|
||||
|
||||
import re
|
||||
from ..http import Session
|
||||
|
||||
|
||||
class ComicsKingdom(_BasicScraper):
|
||||
|
@ -15,9 +22,19 @@ class ComicsKingdom(_BasicScraper):
|
|||
namer = joinPathPartsNamer((-2, -1), ())
|
||||
help = 'Index format: yyyy-mm-dd'
|
||||
|
||||
@cached_property
|
||||
def session(self):
|
||||
'''Use our own isolated session (ComicsKingdom screws up their TLS setup
|
||||
from time to time, this should "fix" it)'''
|
||||
s = Session()
|
||||
# slightly iffy hack taken from certifi
|
||||
self.cert_ctx = get_path("dosagelib.data", "godaddy-bundle-g2-2031.pem")
|
||||
s.verify = str(self.cert_ctx.__enter__())
|
||||
return s
|
||||
|
||||
def __init__(self, name, path):
|
||||
super(ComicsKingdom, self).__init__('ComicsKingdom/' + name)
|
||||
self.url = 'https://www.comicskingdom.com/' + path
|
||||
self.url = 'https://comicskingdom.com/' + path
|
||||
self.stripUrl = self.url + '/%s'
|
||||
|
||||
def link_modifier(self, url, tourl):
|
||||
|
|
|
@ -40,6 +40,7 @@ install_requires =
|
|||
requests>=2.0
|
||||
cached_property;python_version<'3.8'
|
||||
importlib_metadata;python_version<'3.8'
|
||||
include_package_data = true
|
||||
python_requires = >=3.6
|
||||
setup_requires =
|
||||
setuptools>=38.3.0
|
||||
|
|
Loading…
Reference in a new issue