pyasn1 error during certificate renewal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
freeipa (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
moving from https:/
ubuntu 18.04, 4.7.0~pre1+
python-pyasn1: 0.4.2-3
python-
Certmonger failed to renew certs on time and they expired. Rolled back the date as per various online suggestions but continually receive the same "903 (RPC failed at server. an internal error has occurred)". Apache error log shows a pyasn1 error (getcert list and apache log excerpt below).
Certs are being generated and appear in the GUI under Authentication > Certificates. 2 new certificates are created each time certmonger tries. for <email address hidden> and <email address hidden>. Notably, trying to view the generated certificates in the gui generates the same 903 / pyasn1 error.
Apache:
-----
[Thu Oct 08 00:02:02.421838 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] ipa: ERROR: non-public: PyAsn1Error: <TagSet object at 0x7ff98039fc90 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7ff98039f8d0 tagSet <TagSet object at 0x7ff99bed4290 tags 0:0:4> encoding iso-8859-1>
[Thu Oct 08 00:02:02.421902 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] Traceback (most recent call last):
[Thu Oct 08 00:02:02.421914 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.421925 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] result = command(*args, **options)
[Thu Oct 08 00:02:02.421935 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.421972 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] return self.__
[Thu Oct 08 00:02:02.421989 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422005 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] ret = self.run(*args, **options)
[Thu Oct 08 00:02:02.422021 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422034 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] return self.execute(*args, **options)
[Thu Oct 08 00:02:02.422048 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422062 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] self.obj.
[Thu Oct 08 00:02:02.422072 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422082 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] cert.san_
[Thu Oct 08 00:02:02.422092 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422102 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] gns = self.__
[Thu Oct 08 00:02:02.422112 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422123 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] ext['extnValue'], asn1Spec=
[Thu Oct 08 00:02:02.422133 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] File "/usr/lib/
[Thu Oct 08 00:02:02.422143 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] '%s not in asn1Spec: %r' % (tagSet, asn1Spec)
[Thu Oct 08 00:02:02.422153 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] PyAsn1Error: <TagSet object at 0x7ff98039fc90 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7ff98039f8d0 tagSet <TagSet object at 0x7ff99bed4290 tags 0:0:4> encoding iso-8859-1>
[Thu Oct 08 00:02:02.422713 2020] [wsgi:error] [pid 7261] [remote 10.1.5.4:58624] ipa: INFO: [xmlserver] <email address hidden>: cert_request(
-----
getcert list:
-----
Number of certificates and requests being tracked: 9.
Request ID '20181021083324':
status: MONITORING
stuck: no
key pair storage: type=FILE,
certificate: type=FILE,
CA: dogtag-
issuer: CN=Certificate Authority,
subject: CN=IPA RA,O=MYREALM.COM
expires: 2022-09-02 02:33:38 MDT
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command: /usr/lib/
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083404':
status: MONITORING
stuck: no
key pair storage: type=NSSDB,
certificate: type=NSSDB,
CA: dogtag-
issuer: CN=Certificate Authority,
subject: CN=localhost
expires: 2022-09-05 12:15:19 MDT
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command: /usr/lib/
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083405':
status: NEED_CSR_GEN_TOKEN
stuck: yes
key pair storage: type=NSSDB,
certificate: type=NSSDB,
CA: dogtag-
issuer: CN=Certificate Authority,
subject: CN=localhost
expires: 2020-10-13 12:14:21 MDT
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command: /usr/lib/
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083406':
status: NEED_CSR_GEN_TOKEN
stuck: yes
key pair storage: type=NSSDB,
certificate: type=NSSDB,
CA: dogtag-
issuer: CN=Certificate Authority,
subject: CN=localhost
expires: 2020-10-13 12:15:01 MDT
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command: /usr/lib/
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083407':
status: NEED_CSR_GEN_TOKEN
stuck: yes
key pair storage: type=NSSDB,
certificate: type=NSSDB,
CA: dogtag-
issuer: CN=Certificate Authority,
subject: CN=localhost
expires: 2020-10-10 02:34:28 MDT
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command: /usr/lib/
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083408':
status: NEED_CSR_GEN_TOKEN
stuck: yes
key pair storage: type=NSSDB,
certificate: type=NSSDB,
CA: dogtag-
issuer: CN=Certificate Authority,
subject: CN=localhost
expires: 2020-10-13 12:14:29 MDT
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command: /usr/lib/
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083613':
status: CA_UNREACHABLE
ca-error: Server at https:/
stuck: no
key pair storage: type=NSSDB,
certificate: type=NSSDB,
CA: IPA
issuer: CN=Certificate Authority,
subject: CN=ipa01.
expires: 2020-10-21 02:36:13 MDT
dns: ipa01.mydomain.com
principal name: <email address hidden>
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command:
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083714':
status: NEED_CSR_GEN_PIN
stuck: yes
key pair storage: type=FILE,
certificate: type=FILE,
CA: IPA
issuer: CN=Certificate Authority,
subject: CN=ipa01.
expires: 2020-10-21 02:37:17 MDT
dns: ipa01.mydomain.com
principal name: <email address hidden>
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command:
post-save command: /usr/lib/
track: yes
auto-renew: yes
Request ID '20181021083724':
status: CA_UNREACHABLE
ca-error: Server at https:/
stuck: no
key pair storage: type=FILE,
certificate: type=FILE,
CA: IPA
issuer: CN=Certificate Authority,
subject: CN=ipa01.
expires: 2020-10-21 02:37:25 MDT
principal name: <email address hidden>
key usage: digitalSignatur
eku: id-kp-serverAut
pre-save command:
post-save command: /usr/lib/
track: yes
auto-renew: yes
I did finally track down the problem.
in the most recent version of x509.py, in the definition of '__pyasn1_ gen_san_ general_ names' (about line 350)
there is a comment:
# pyasn1 <= 0.3.7 needs explicit unwrap of ANY container /pagure. io/freeipa/ issue/7685
# see https:/
Apparently > 0.3.7 needs to *not* be unwrapped (I don't know what that means) but in my version of x509.py changing line 349:
der = decoder. decode( ext['extnValue' ], asn1Spec= univ.OctetStrin g())[0]
>
der = ext['extnValue']
fixed the problem.
In case someone else comes across this.