aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sec_certs/sample
diff options
context:
space:
mode:
authorJ08nY2024-10-01 13:55:35 +0200
committerJ08nY2024-10-01 13:55:35 +0200
commit177395727f339b902a03ff1a72e112babab8b9ad (patch)
tree128aab971a1d83c29bf77bf026d31ccc04dc98d8 /src/sec_certs/sample
parentec41dd32cbb84252ad6d15f3978cf07136237c28 (diff)
downloadsec-certs-177395727f339b902a03ff1a72e112babab8b9ad.tar.gz
sec-certs-177395727f339b902a03ff1a72e112babab8b9ad.tar.zst
sec-certs-177395727f339b902a03ff1a72e112babab8b9ad.zip
Ignore certs in Korean CC download.
Diffstat (limited to 'src/sec_certs/sample')
-rw-r--r--src/sec_certs/sample/cc_scheme.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sec_certs/sample/cc_scheme.py b/src/sec_certs/sample/cc_scheme.py
index 8300cc38..acde91b9 100644
--- a/src/sec_certs/sample/cc_scheme.py
+++ b/src/sec_certs/sample/cc_scheme.py
@@ -86,12 +86,12 @@ def _get(url: str, session=None, **kwargs) -> Response:
return _getq(url, None, session, **kwargs)
-def _get_page(url: str, session=None) -> BeautifulSoup:
- return BeautifulSoup(_get(url, session).content, "html5lib")
+def _get_page(url: str, session=None, **kwargs) -> BeautifulSoup:
+ return BeautifulSoup(_get(url, session, **kwargs).content, "html5lib")
-def _get_hash(url: str, session=None) -> bytes:
- resp = _get(url, session)
+def _get_hash(url: str, session=None, **kwargs) -> bytes:
+ resp = _get(url, session, **kwargs)
h = hashlib.sha256()
for chunk in resp.iter_content():
h.update(chunk)
@@ -1066,7 +1066,7 @@ def _get_korea( # noqa: C901
product_class: int, enhanced: bool, artifacts: bool
) -> list[dict[str, Any]]:
session = requests.session()
- session.get(constants.CC_KOREA_EN_URL)
+ session.get(constants.CC_KOREA_EN_URL, verify=False)
# Get base page
url = constants.CC_KOREA_CERTIFIED_URL + f"?product_class={product_class}"
soup = _get_page(url, session=session)
@@ -1076,7 +1076,7 @@ def _get_korea( # noqa: C901
while pages:
page = pages.pop()
csrf = soup.find("form", id="fm").find("input", attrs={"name": "csrf"})["value"]
- resp = session.post(url, data={"csrf": csrf, "selectPage": page, "product_class": product_class})
+ resp = session.post(url, data={"csrf": csrf, "selectPage": page, "product_class": product_class}, verify=False)
soup = BeautifulSoup(resp.content, "html5lib")
tbody = soup.find("table", class_="cpl").find("tbody")
for tr in tbody.find_all("tr"):
@@ -1098,7 +1098,7 @@ def _get_korea( # noqa: C901
e: dict[str, Any] = {}
if not cert["product_link"]:
continue
- cert_page = _get_page(cert["product_link"], session)
+ cert_page = _get_page(cert["product_link"], session=session)
main = cert_page.find("div", class_="mainContent")
table = main.find("table", class_="shortenedWidth")
v = e