| - 創建順序..
| - 獲取驗證信息..
|-Verification type: dns-01
Traceback (most recent call last):
File "/www/server/panel/class/acme_v2.py", line 1804, in apply_cert
self.get_auths(index)
File "/www/server/panel/class/acme_v2.py", line 544, in get_auths
self.set_auth_info(identifier_auth, index=index)
File "/www/server/panel/class/acme_v2.py", line 573, in set_auth_info
self.create_dns_record(
File "/www/server/panel/class/acme_v2.py", line 798, in create_dns_record
self._dns_class.create_dns_record(public.de_punycode(domain), dns_value)
File "/www/server/panel/class/panelDnsapi.py", line 374, in create_dns_record
self.delete_dns_record(domain_name, domain_dns_value)
File "/www/server/panel/class/panelDnsapi.py", line 457, in delete_dns_record
self.remove_record(root,acme_txt,'TXT')
File "/www/server/panel/class/panelDnsapi.py", line 436, in remove_record
record_id = self.query_recored_id(domain,host,s_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/www/server/panel/class/panelDnsapi.py", line 428, in query_recored_id
recoreds = self.query_recored_items(root, zone, tipe=tipe)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/www/server/panel/class/panelDnsapi.py", line 421, in query_recored_items
Signature = self.sign(self.secret, paramsdata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/www/server/panel/class/panelDnsapi.py", line 368, in sign
signature = base64.encodestring(h.digest()).strip()
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'base64' has no attribute 'encodestring'
/www/server/panel/class_v2/panel_dns_api_v2.py
第368行未适配python3
应该将signature = base64.encodestring(h.digest()).strip()
改为
Python 2 和 Python 3 兼容处理
if sys.version_info[0] == 2:
signature = base64.encodestring(h.digest()).strip()
else:
signature = base64.encodebytes(h.digest()).decode('utf-8').strip()
或者直接适配signature = base64.encodebytes(h.digest()).decode('utf-8').strip()