[Python-modules-team] Bug#471357: ython-zsi: Wsdl2py generates faulty code for ssl secured services (https://...)

Leszek Dubiel leszek at dubiel.pl
Mon Mar 17 17:13:02 UTC 2008


Package: python-zsi
Version: 1.7-2
Severity: normal


Tool wsdl2py generates two files -- one for service description and one
for types description.

But service location is not handled properely, because it ignores
protocol name -- it assumes that http is used and port 80. I would
suggest to take https in consideration. 

So instead of:         

        netloc = (urlparse.urlparse(addr)[1]).split(":") + [80,]
        if not kw.has_key("host"):
            kw["host"] = netloc[0]
        if not kw.has_key("port"):
            kw["port"] = int(netloc[1])
        if not kw.has_key("url"):
            kw["url"] =  urlparse.urlparse(addr)[2]


it should generate: 

        netloc = list(urlparse.urlparse(addr))
        netloc[1] = netloc[1].split(':')
        netloc[1].extend(netloc[0] == 'http' and ['80',] or ['443',])
        if not kw.has_key("host"):
            kw["host"] = netloc[1][0]
        if not kw.has_key("port"):
            kw["port"] = int(netloc[1][1])
        if not kw.has_key("url"):
            kw["url"] =  netloc[2]
        if netloc[0][-1] == 's':
            kw["ssl"] = True

After this change ssl=True and port=443 is set properely. 


File wsdl2python.py is responsible for this program. 










-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-iplus
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)

Versions of packages python-zsi depends on:
ii  python                        2.4.4-2    An interactive high-level object-o
ii  python-central                0.5.12     register and build utility for Pyt
ii  python-xml                    0.8.4-6    XML tools for Python

python-zsi recommends no packages.

-- no debconf information






More information about the Python-modules-team mailing list