예제 #1
0
    def test_ssl_fail_when_requesting_moth_http(self):
        """
        https://github.com/andresriancho/w3af/issues/7989

        This test takes considerable time to run since it needs to timeout the
        SSL connection for each SSL protocol
        """
        # Note that here I'm using httpS <<---- "S" and that I'm connecting to
        # the net location (host:port) of an HTTP server.
        http_url = URL(get_moth_http())
        test_url = URL('https://%s' % http_url.get_net_location())

        self.uri_opener.settings.set_max_http_retries(0)

        self.assertRaises(HTTPRequestException,
                          self.uri_opener.GET,
                          test_url,
                          timeout=1)
예제 #2
0
파일: test_xurllib.py 프로젝트: sxhao/w3af
    def test_ssl_fail_when_requesting_moth_http(self):
        """
        https://github.com/andresriancho/w3af/issues/7989

        This test takes considerable time to run since it needs to timeout the
        SSL connection for each SSL protocol
        """
        # Note that here I'm using httpS <<---- "S" and that I'm connecting to
        # the net location (host:port) of an HTTP server.
        http_url = URL(get_moth_http())
        test_url = URL('https://%s' % http_url.get_net_location())

        self.uri_opener.settings.set_max_http_retries(0)

        self.assertRaises(HTTPRequestException,
                          self.uri_opener.GET,
                          test_url,
                          timeout=1)
    def test_set_domain_with_port(self):
        u = URL("http://w3af.com:443/def/jkl/")
        self.assertEqual(u.get_domain(), "w3af.com")

        u.set_domain("host.tld")
        self.assertEqual(u.get_net_location(), "host.tld:443")
예제 #4
0
    def test_set_domain_with_port(self):
        u = URL('http://w3af.com:443/def/jkl/')
        self.assertEqual(u.get_domain(), 'w3af.com')

        u.set_domain('host.tld')
        self.assertEqual(u.get_net_location(), 'host.tld:443')
예제 #5
0
파일: test_url.py 프로젝트: 3rdDegree/w3af
 def test_set_domain_with_port(self):
     u = URL('http://w3af.com:443/def/jkl/')
     self.assertEqual(u.get_domain(), 'w3af.com')
     
     u.set_domain('host.tld')
     self.assertEqual(u.get_net_location(), 'host.tld:443')