| 10 | |
| 11 | |
| 12 | class Options(optmanager.OptManager): |
| 13 | def __init__(self, **kwargs) -> None: |
| 14 | super().__init__() |
| 15 | self.add_option( |
| 16 | "server", bool, True, "Start a proxy server. Enabled by default." |
| 17 | ) |
| 18 | self.add_option( |
| 19 | "showhost", |
| 20 | bool, |
| 21 | False, |
| 22 | """Use the Host header to construct URLs for display. |
| 23 | |
| 24 | This option is disabled by default because malicious apps may send misleading host headers to evade |
| 25 | your analysis. If this is not a concern, enable this options for better flow display.""", |
| 26 | ) |
| 27 | self.add_option( |
| 28 | "show_ignored_hosts", |
| 29 | bool, |
| 30 | False, |
| 31 | """ |
| 32 | Record ignored flows in the UI even if we do not perform TLS interception. |
| 33 | This option will keep ignored flows' contents in memory, which can greatly increase memory usage. |
| 34 | A future release will fix this issue, record ignored flows by default, and remove this option. |
| 35 | """, |
| 36 | ) |
| 37 | |
| 38 | # Proxy options |
| 39 | self.add_option( |
| 40 | "add_upstream_certs_to_client_chain", |
| 41 | bool, |
| 42 | False, |
| 43 | """ |
| 44 | Add all certificates of the upstream server to the certificate chain |
| 45 | that will be served to the proxy client, as extras. |
| 46 | """, |
| 47 | ) |
| 48 | self.add_option( |
| 49 | "confdir", |
| 50 | str, |
| 51 | CONF_DIR, |
| 52 | "Location of the default mitmproxy configuration files.", |
| 53 | ) |
| 54 | self.add_option( |
| 55 | "certs", |
| 56 | Sequence[str], |
| 57 | [], |
| 58 | """ |
| 59 | SSL certificates of the form "[domain=]path". The domain may include |
| 60 | a wildcard, and is equal to "*" if not specified. The file at path |
| 61 | is a certificate in PEM format. If a private key is included in the |
| 62 | PEM, it is used, else the default key in the conf dir is used. The |
| 63 | PEM file should contain the full certificate chain, with the leaf |
| 64 | certificate as the first entry. |
| 65 | """, |
| 66 | ) |
| 67 | self.add_option( |
| 68 | "cert_passphrase", |
| 69 | Optional[str], |
no outgoing calls
searching dependent graphs…