[Python-modules-team] Bug#992156: python3-dnspython: Using -a dns-rfc2136 option you'll get: AttributeError: module 'base64' has no attribute 'decodestring'

midget debian at midworld.net
Sat Aug 14 01:59:56 BST 2021


Package: python3-dnspython
Version: 2.0.0-1
Severity: important

Dear Maintainer,

I'm trying to request a new certificate using cerbot+dns-rfc2136 with 
the following command:

```
/usr/bin/certbot certonly --debug -a dns-rfc2136 
--dns-rfc2136-credentials /etc/bind/rfc2136.ini 
--dns-rfc2136-propagation-seconds 5  -d "*.${DOMAIN}" -d "${DOMAIN}" -m 
${EMAIL} --server https://acme-v02.api.letsencrypt.org/directory
```

and I get the following error:

--%<-------------------------------------------------------------------------------------------------------
Encountered exception during recovery: AttributeError: module 'base64' 
has no attribute 'decodestring'
Exiting abnormally:
Traceback (most recent call last):
   File "/usr/bin/certbot", line 33, in <module>
     sys.exit(load_entry_point('certbot==1.12.0', 'console_scripts', 
'certbot')())
   File "/usr/lib/python3/dist-packages/certbot/main.py", line 15, in main
     return internal_main.main(cli_args)
   File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 
1413, in main
     return config.func(config, plugins)
   File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 
1293, in certonly
     lineage = _get_and_save_cert(le_client, config, domains, certname, 
lineage)
   File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 
134, in _get_and_save_cert
     lineage = le_client.obtain_and_enroll_certificate(domains, certname)
   File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", 
line 441, in obtain_and_enroll_certificate
     cert, chain, key, _ = self.obtain_certificate(domains)
   File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", 
line 374, in obtain_certificate
     orderr = self._get_order_and_authorizations(csr.data, 
self.config.allow_subset_of_names)
   File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", 
line 421, in _get_order_and_authorizations
     authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
   File 
"/usr/lib/python3/dist-packages/certbot/_internal/auth_handler.py", line 
70, in handle_authorizations
     resps = self.auth.perform(achalls)
   File "/usr/lib/python3/dist-packages/certbot/plugins/dns_common.py", 
line 57, in perform
     self._perform(domain, validation_domain_name, validation)
   File 
"/usr/lib/python3/dist-packages/certbot_dns_rfc2136/_internal/dns_rfc2136.py", 
line 87, in _perform
     self._get_rfc2136_client().add_txt_record(validation_name, 
validation, self.ttl)
   File 
"/usr/lib/python3/dist-packages/certbot_dns_rfc2136/_internal/dns_rfc2136.py", 
line 93, in _get_rfc2136_client
     return _RFC2136Client(self.credentials.conf('server'),
   File 
"/usr/lib/python3/dist-packages/certbot_dns_rfc2136/_internal/dns_rfc2136.py", 
line 109, in __init__
     self.keyring = dns.tsigkeyring.from_text({
   File "/usr/lib/python3/dist-packages/dns/tsigkeyring.py", line 35, in 
from_text
     secret = base64.decodestring(maybe_encode(textring[keytext]))
AttributeError: module 'base64' has no attribute 'decodestring'
--%<-------------------------------------------------------------------------------------------------------

As a quick fix I've modified 
/usr/lib/python3/dist-packages/dns/tsigkeyring.py replacing this strings:

s/encodestring/encodebytes/g
s/decodestring/decodebytes/g

And everthing is working as expected again.

Thanks for reading

Regards,

-- System Information:
Debian Release: 11.0
   APT prefers unstable
   APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_CPU_OUT_OF_SPEC, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to 
en_US.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-dnspython depends on:
ii  netbase  6.3
ii  python3  3.9.2-3

Versions of packages python3-dnspython recommends:
ii  ca-certificates            20210119
ii  python3-cryptography       3.3.2-1
ii  python3-idna               2.10-1
ii  python3-requests           2.25.1+dfsg-2
ii  python3-requests-toolbelt  0.9.1-1

Versions of packages python3-dnspython suggests:
pn  python3-sniffio  <none>
pn  python3-trio     <none>

-- no debconf information


-- 
  Dario Minnucci <midget at debian.org>
  Phone: +34 902021030
  Key fingerprint = BAA1 7AAF B21D 6567 D457  D67D A82F BB83 F3D5 7033

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA82FBB83F3D57033_and_old_rev.asc
Type: application/pgp-keys
Size: 215975 bytes
Desc: OpenPGP public key
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20210814/1168d48a/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20210814/1168d48a/attachment-0001.sig>


More information about the Python-modules-team mailing list