百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#1890·Deep-Live-Cam

在 macOS 版本下载时,ssl._create_unverified_context() 会启用 MITM 模型注入

作者: AAtomical创建于 2026年7月29日更新于 2026年7月29日

def gen_cert(tmp): from cryptography import x509 from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.x509.oid import NameOID key = rsa.generate_private_key(65537, 2048) cert = (x509.CertificateBuilder() .subject_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, "GitHub.com")])) .issuer_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, "GitHub.com")])) .public_key(key.public_key()).serial_number(x509.random_serial_number()) .not_valid_before(datetime.now(timezone.utc)) .not_valid_after(datetime.now(timezone.utc) + timedelta(days=1)) .sign(key, hashes.SHA256())) cp, kp = os.path.join(tmp, "cert.pem"), os.path.join(tmp, "key.pem") with open(cp, "wb") as f: f.write(cert.public_bytes(serialization.Encoding.PEM)) with open(kp, "wb") as f: f.write(key.private_bytes(serialization.Encoding.PEM, serialization.PrivateFormat.TraditionalOpenSSL, serialization.NoEncryption())) return cp, kp

内容来源: hacksider/Deep-Live-Cam

查看 GitHub 原文在 GitHub 查看讨论