Mac下Goagent打开部分https链接无法访问,goagenthttps,调试后发现在“OpenS
Mac下Goagent打开部分https链接无法访问,goagenthttps,调试后发现在“OpenS
调试后发现在“OpenSSL is None”就跳出了
google之后发现 python是不带OpenSSL的,需要自行安装
1、安装Command Line Tools
2、安装pyOpenSSL
curl -L -Ohttp://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz &&tar zxvf pyOpenSSL-0.13.tar.gz && cd pyOpenSSL-0.13 && sudo python3 setup.pyinstall
重新运行一下应该可以了
def get_cert(commonname, sans=[]): #如果是二级域名并且域名长度大于4,则生成的文件前加. if commonname.count('.') >= 2 and len(commonname.split('.')[-2]) > 4: commonname = '.'+commonname.partition('.')[-1] certfile = os.path.join(CertUtil.ca_certdir, commonname + '.crt') if os.path.exists(certfile): return certfile elif OpenSSL is None: return CertUtil.ca_keyfile else:#如果证书不存在则创建 with CertUtil.ca_lock: if os.path.exists(certfile): return certfile return CertUtil._get_cert(commonname, sans) @staticmethod#该片段来自于http://byrx.net
相关内容
- cutescan.py,,cutescan.py
- Python一句话生成N个随机数并挑出某个范围内的,pytho
- 比“目前最快的素数生产“快7倍,目前素数生产7倍,用
- python爬虫,抓豆瓣勾搭组妹纸照片,,import urlli
- 通过logging与ctypes打印不同颜色的日志,loggingctypes日志
- 爬取中图分类法,爬取图分类法,# -*- coding
- 发邮件(全功能),发邮件全功能,#coding=utf-
- python发微博升级版,python发微博,上次发了一个利用新浪
- python 微信自定义菜单的管理,python信自定义菜单,# -*
- 简易发送邮件(仅限普通文本,发送邮箱需开启smtp),
评论关闭