/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_https_urllib.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    trace,
27
27
)
28
28
from .. import tests
29
 
from ..transport.http import _urllib2_wrappers
30
 
from ..transport.http._urllib2_wrappers import ssl
 
29
from ..transport.http import ssl, opt_ssl_ca_certs
31
30
 
32
31
 
33
32
class CaCertsConfigTests(tests.TestCaseInTempDir):
49
48
    def test_specified_doesnt_exist(self):
50
49
        stack = self.get_stack('')
51
50
        # Disable the default value mechanism to force the behavior we want
52
 
        self.overrideAttr(_urllib2_wrappers.opt_ssl_ca_certs, 'default',
 
51
        self.overrideAttr(opt_ssl_ca_certs, 'default',
53
52
                          os.path.join(self.test_dir, u"nonexisting.pem"))
54
53
        self.warnings = []
55
54
 
102
101
 
103
102
        # Python Issue #17980: avoid denials of service by refusing more than
104
103
        # one wildcard per fragment.
105
 
        ok({'subject': ((('commonName', 'a*b.com'),),)}, 'axxb.com')
 
104
        if sys.version_info[:2] >= (3, 7):
 
105
            # Python 3.7 dropped support for partial wildcards, see
 
106
            # https://docs.python.org/3/whatsnew/3.7.html#ssl
 
107
            not_ok({'subject': ((('commonName', 'a*b.com'),),)}, 'axxb.com')
 
108
        else:
 
109
            ok({'subject': ((('commonName', 'a*b.com'),),)}, 'axxb.com')
106
110
        not_ok({'subject': ((('commonName', 'a*b.co*'),),)}, 'axxb.com')
107
111
        not_ok({'subject': ((('commonName', 'a*b*.com'),),)}, 'axxbxxc.com')
108
112