aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Integrate lxml for pretty-printing HTML and XML.Aldo Cortesi2012-04-071-58/+0
| | | | | Tackling the pretty-printing performance problem head-on, at the cost of a major dependency.
* Add a variant of cleanBin that escapes newlines and tabs.Aldo Cortesi2012-03-271-0/+10
| | | | Use this to fix the hex display option.
* Add a simple parser for content type specifications.Aldo Cortesi2012-03-201-0/+11
|
* Cleanliness fixes.Aldo Cortesi2012-03-121-0/+1
| | | | | - Remove unused code during previous commit. - Code coverage fixes.
* Removed imports left unused after Py{OpenSSL,ASN1}András Veres-Szentkirályi2012-03-011-1/+1
| | | | | | Commits 533f61f67aab38f5bce882ad0dc03b7b5f292956 and 8b841bc9e370370716b473f26e001c65e2eee2af left some imports unused while swithing to PyOpenSSL and PyASN1 -- this commit removes these imports.
* Factor out cert operations in to certutils.py.Aldo Cortesi2012-02-291-63/+0
|
* Repair unit tests.Aldo Cortesi2012-02-271-3/+2
|
* Fix cert generation harder.Aldo Cortesi2012-02-271-1/+3
|
* Better certificate parsing.Aldo Cortesi2012-02-271-0/+6
|
* Add upstream certificate lookup.Aldo Cortesi2012-02-271-3/+15
| | | | | | This initiates a connection to the server to obtain certificate information to generate interception certificates. At the moment, the information used is the Common Name, and the list of Subject Alternative Names.
* Unit test import cleanups.Aldo Cortesi2012-02-201-3/+3
|
* Firm up what we consider to be a valid proxy spec.Aldo Cortesi2012-02-181-0/+1
|
* Firm up reverse proxy specification.Aldo Cortesi2012-02-181-0/+9
| | | | | | - Extract proxy spec parsing and unparsing functions. - Add a status indicator in mitmproxy. - Add the "R" keybinding for changing the reverse proxy from within mitmproxy.
* Refactor reverse proxyingAldo Cortesi2012-02-181-0/+8
| | | | | | | - Retain the specification from the Host header as a Request's description. - Expand upstream proxy specifications to include the scheme. We now say https://hostname:port - Move the "R" revert keybinding to "v" to make room for a reverse proxy binding that matches the command-line flag.
* Expand test coverage.Aldo Cortesi2012-02-101-1/+11
|
* Fix unit tests broken during previous commit.Aldo Cortesi2012-01-211-4/+4
|
* Add HTTP body size limit specification to command-line tools.Aldo Cortesi2011-09-091-1/+13
|
* Improve robustness against invalid data.Aldo Cortesi2011-09-051-0/+3
|
* Code cleanliness - appease pychecker.Aldo Cortesi2011-08-041-1/+1
|
* Move all HTTP objects to flow.pyAldo Cortesi2011-08-031-104/+25
| | | | That's Request, Response, ClientConnect, ClientDisconnect, Error, and Headers.
* Unit test++Aldo Cortesi2011-08-021-0/+7
|
* General cleanup.Aldo Cortesi2011-08-021-23/+1
| | | | | Cut out unused variables and code, generally shut up pychecker as much as is reasonable.
* Add utility functions to search and replace strings in flowsAldo Cortesi2011-07-221-0/+9
| | | | | | | | | | This is a common task in pentesting scenarios. This commit adds the following functions: utils.Headers.replace proxy.Request.replace proxy.Response.replace flow.Flow.replace
* Adds support for content encoding, namely gip and deflatealts2011-07-161-1/+1
|
* Add a pretty-printing mode for urlencoded form data.Aldo Cortesi2011-07-151-0/+7
|
* Rewrite Headers object to preserve order and case.Aldo Cortesi2011-07-141-92/+22
|
* JSON pretty-printing.Aldo Cortesi2011-06-301-1/+9
| | | | | Also rename the display modes ("pretty" instead of "indent"), and expand the built-in documentation.
* Try not to hang when user views large request & response bodiesAldo Cortesi2011-06-271-0/+8
| | | | | | | | | | Two different strategies here: - Use a simple heuristic to detect if we're looking at XML data when indent mode is used. On non-XML data we can hang even on small documents. - Only view partial data for large bodies. At the moment the cutoff is 100k. I might finetune this later.
* Add a hideous kludge to fix not-yet-valid certificates.Aldo Cortesi2011-06-111-0/+2
| | | | | | | | | | | | - The OpenSSL x509 has no way to explicitly set the notBefore value on certificates. - If two systems have the same configured time, it's possible to return a certificate before the validity start time has arrived. - We "solve" this by waiting for one second when a certificate is first generated before returning the cert. The alternative is to rewrite pretty much all of our certificate generation, a thought too horrible to contemplate.
* Revamp key generation.Aldo Cortesi2011-03-181-0/+6
| | | | | | | | | | | We now create three different files in the .mitmproxy directory when a dummy CA is made: mitmproxy-ca.pem - the CA, including private key mitmproxy-ca-cert.p12 - A pkcs12 version of the certificate, for distribution to Windows. mitmproxy-ca-cert.pem - A PEM version of the certificate, for distribution to everyone else.
* Improve responsiveness of request and response viewing.Aldo Cortesi2011-03-151-0/+31
| | | | | | | | - Computing the view of a large body is expensive, so we introduce an LRU cache to hold the latest 20 results. - Use ListView more correctly, passing it individual urwid.Text snippets, rather than a single large one. This hugely improves render time.
* Store timestamps on flow components as a UTC time tuple.Aldo Cortesi2011-03-071-1/+1
| | | | | | Format is: (tm_year,tm_mon,tm_mday,tm_hour,tm_min, tm_sec,tm_wday,tm_yday,tm_isdst)
* Minor housekeeping - unused code, nocover directives.Aldo Cortesi2011-02-241-3/+0
| | | | 95% test coverage.
* Revamp SSL configuration.Aldo Cortesi2011-02-201-0/+6
| | | | | | | | - Move option parsing utiliities to proxy.py - Don't have a global config object. Pass it as an argument to ProxyServer. - Simplify certificate generation logic.
* Clean up certificate generation.Aldo Cortesi2011-02-201-11/+33
| | | | | | | | | | | | - Use templates for config files. We can re-introduce customization of the certificate attributes when we need them. - Split CA and cert generation into separate functions. - Generation methods provide an error return when generation fails. - When the user explicitly specifies a certificate, we don't generate it, but fail if it doesn't exist.
* Further fine-tuning for pretty_xmlish.Aldo Cortesi2011-02-061-1/+4
|
* Rip out BeautifulSoup, and use a custom XML-ish prettyprinter.Aldo Cortesi2011-02-061-7/+53
|
* Add timestamps to flows.Aldo Cortesi2011-02-031-1/+7
| | | | | For now, these are only displayed on the connection view screen, with second granularity.
* UI tweaksAldo Cortesi2011-01-301-1/+0
| | | | | - Make flow view state persistent (request/response, body view mode). - Don't exit flow view mode when viewing help.
* Nicer statusbar messages, with timed expiry.Aldo Cortesi2011-01-281-1/+1
|
* Make pretty-printing more robust.Aldo Cortesi2011-01-281-0/+5
| | | | | | Also, since BeautifulSoup is so damn slow, print a statusbar message saying that we're calculating a pretty version of the response. Maybe I should add hangman or something, becuase on a 200k document this can take ages.
* Basix XML/HTML pretty-printing in flow viewer.Aldo Cortesi2011-01-271-0/+7
|
* Add serialization hooks to flows and flow component objects.Aldo Cortesi2011-01-261-0/+15
|
* Initial checkin.Aldo Cortesi2010-02-161-0/+221