Skip to content

Commit 9a543a8

Browse files
aojeagarciaAntonio Ojea
authored andcommitted
Don't use ipv6 for DNS SAN fields with python3
Python2 match routines for x509 fields are broken and have to use the DNS field for ip addresses. The problem is that if you use ipv6 addresses in the DNS field, urllib3 fails when trying to encode it. Since python3 match routines for x509 fields are correct, this patch disables the hack for python3, encoding the ip address in the corresponding field only of the certificate. Partial-Bug: #1794929 Depends-On: https://review.openstack.org/#/c/608468 Change-Id: I7b9cb15ccfa181648afb12be51ee48bed14f9156 Signed-off-by: aojeagarcia <aojeagarcia@suse.com>
1 parent 02ca8da commit 9a543a8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/tls

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ function init_CA {
227227
function init_cert {
228228
if [[ ! -r $DEVSTACK_CERT ]]; then
229229
if [[ -n "$TLS_IP" ]]; then
230-
# Lie to let incomplete match routines work
231-
# see https://bugs.python.org/issue23239
232-
TLS_IP="DNS:$TLS_IP,IP:$TLS_IP"
230+
if python3_enabled; then
231+
TLS_IP="IP:$TLS_IP"
232+
else
233+
# Lie to let incomplete match routines work with python2
234+
# see https://bugs.python.org/issue23239
235+
TLS_IP="DNS:$TLS_IP,IP:$TLS_IP"
236+
fi
233237
fi
234238
make_cert $INT_CA_DIR $DEVSTACK_CERT_NAME $DEVSTACK_HOSTNAME "$TLS_IP"
235239

0 commit comments

Comments
 (0)