A proxy wrapper that adds HTTPS capabilities to Privoxy
 
 
 
Go to file
Michele Guerini Rocco a0155c5949
reorganize source tree
2019-09-18 21:56:52 +02:00
src reorganize source tree 2019-09-18 21:56:52 +02:00
static reorganize source tree 2019-09-18 21:56:52 +02:00
.gitignore big refactor for privoxy 2019-05-07 12:06:21 +02:00
LICENSE Initial commit 2015-01-07 10:46:01 +08:00
README.md fix typos 2019-09-18 21:02:52 +02:00
service.nix extraConfig -> settings 2019-09-18 15:47:15 +02:00

README.md

Privoxy TLS proxy wrapper

How it works

 +---------+                        +-----------+                        +----------------+
 |         |                        |           |                        |                |
 | Browser +<---------HTTP--------->+  Privoxy  +<---------HTTP--------->+ HTTP webserver |
 |         |                        |           |                        |                |
 +----+----+                        +---+---+---+                        +----------------+
      ^                                 ^   ^
      |                                 |   |
      |         +--------------------------------------------------+
      |         |                       |   |                      |
      |         |  +---------+          |   |          +--------+  |          +-----------------+
      |         |  |         |          |   |          |        |  |          |                 |
      +---HTTPS--->+  Front  +<--HTTP*--+   +---HTTP-->+  Rear  +<---HTTPS--->+ HTTPS webserver |
                |  |         |                         |        |  |          |                 |
                |  +---------+                         +--------+  |          +-----------------+
                |                                                  |
                +--------------------------------------------------+

                                                    Transparent MitM

 * Tagged for forwarding

Setup in NixOS

  1. Import to the file ./service.nix in your configuration by adding:
  imports = [
    (fetchGit https://maxwell.ydns.eu/git/rnhmjoj/privoxy-tls + "/service.nix")
  ];

or, better, copy it locally.

  1. Create a CA. For example with GnuTLS:
certtool --generate-privkey --outfile ca.key
certtool --generate-self-signed --load-privkey ca.key --outfile ca.crt

or use the tool ./cert.py provided

python cert.py -f output

In the latter the "output" file will contain both private key and certificate; split the file and store them separately.

  1. Configure the proxy with the option set services.privoxy.tls-wrapper, for example
  services.privoxy.tls-wrapper = {
      enable = true;
      caCert = /path/to/ca.crt; # these won't be included in the store
      caKey  = /path/to/ca.key;
      noVerify = [ "self-signed.example" ];
      passthru = [ "localhost" "*.local" ];
    };
  };

More options are available and documented in ./service.nix

Notes

  • The CA will be automatically installed in the system trust store but applications may use their own store and won't trust it. You will need to add the CA manually in that case.

License

The MIT License (MIT)

Copyright (c) 2015 wheever

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.