access.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:python-fritzbox 作者: pamapa 项目源码 文件源码
def save_certificate(self):
    port = self.url.port if self.url.port else 443
    adr = (self.url.hostname, port)
    if self.debug: print("save_certificate of %s to %s" % (str(adr), self.cafile))
    capath = os.path.dirname(self.cafile)
    if not os.path.exists(capath): os.makedirs(capath)
    cert = ssl.get_server_certificate(adr)
    with open(self.cafile, "w") as outfile:
      outfile.write(cert)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号