AlliotTech / python-safeline

MIT License
6 stars 1 forks source link

SSLCertVerificationError #1

Open YuukiHibiki opened 2 hours ago

YuukiHibiki commented 2 hours ago

脚本

from safeline import SafeLine                                                                                                                          
if __name__ == '__main__':
    BASE_URL = "https://<ip>:9443"
    USERNAME = ""
    PASSWORD = ""
    OTP_SECRET = ""
    CERT_FILE_PATH = ""
    CERT_KEY_PATH = ""
    CERT_ID = "1" 
    waf = SafeLine(BASE_URL,
                   USERNAME,
                   PASSWORD,
                   OTP_SECRET
                   )
    print(waf.certification.list)
    with open(CERT_FILE_PATH, 'r') as cert_file:
        cert_str = cert_file.read()
    with open(CERT_KEY_PATH, 'r') as key_file:
        cert_key = key_file.read()
    waf.certification.update(CERT_ID, cert_str, cert_key)

执行结果

Max retries exceeded with url: /api/open/auth/csrf (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1131)')))
AlliotTech commented 2 hours ago

SSL证书没配?

YuukiHibiki commented 2 hours ago

雷池部署初始化是自签名证书来着,是需要先把雷池自己也配上证书才可以?但是我看SafeLine好像是禁用了verify啊2024年10月22日 17:51,Alliot @.***>写道: SSL证书没配?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>