Skip to content

Commit

Permalink
disable certificate checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hannob committed Jul 26, 2024
1 parent f52d553 commit fac1e72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion keyfinder
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import warnings

import bs4
import requests
import urllib3
from cryptography.hazmat.primitives import serialization

rex_t = r"-----BEGIN[A-Z ]* PRIVATE KEY-----.*?-----END[A-Z ]* PRIVATE KEY-----"
Expand Down Expand Up @@ -154,13 +155,15 @@ if __name__ == "__main__":
# Prevents BeautifulSoup warnings, e.g., when content only
# contains a single URL or a filename.
warnings.filterwarnings("ignore", category=bs4.MarkupResemblesLocatorWarning)
# Disable TLS certificate verification warning.
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

if args.url:
for url in args.input:
host = urllib.parse.urlparse(url).netloc
today = datetime.datetime.now(tz=datetime.timezone.utc).date().isoformat()
meta = f"url: {url}\ndate: {today}\n\n"
r = requests.get(url, timeout=60)
r = requests.get(url, timeout=60, verify=False)
keys = findkeys(r.content)
for k in keys:
writekey(meta + k, host, args.outdir)
Expand Down
2 changes: 1 addition & 1 deletion runci.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -euo pipefail

ruff check --select=ALL --ignore=PTH,ANN,D,ERA,S310,T201,C,PLR keyfinder
ruff check --select=ALL --ignore=PTH,ANN,D,ERA,S310,T201,C,PLR,S501 keyfinder
black --check --diff keyfinder

0 comments on commit fac1e72

Please sign in to comment.