Giter Club home page Giter Club logo

ssl-proxy's Introduction

ssl-proxy

Simple single-command SSL reverse proxy with autogenerated certificates (LetsEncrypt, self-signed)

A handy and simple way to add SSL to your thing running on a VM--be it your personal jupyter notebook or your team jenkins instance. ssl-proxy autogenerates SSL certs and proxies HTTPS traffic to an existing HTTP server in a single command.

Usage

With auto self-signed certificates

ssl-proxy -from 0.0.0.0:4430 -to 127.0.0.1:8000

This will immediately generate self-signed certificates and begin proxying HTTPS traffic from https://0.0.0.0:4430 to http://127.0.0.1:8000. No need to ever call openssl. It will print the SHA256 fingerprint of the cert being used for you to perform manual certificate verification in the browser if you would like (before you "trust" the cert).

I know nginx is often used for stuff like this, but I got tired of dealing with the boilerplate and wanted to explore something fun. So I ended up throwing this together.

With auto LetsEncrypt SSL certificates

ssl-proxy -from 0.0.0.0:443 -to 127.0.0.1:8000 -domain=mydomain.com

This will immediately generate, fetch, and serve real LetsEncrypt certificates for mydomain.com and begin proxying HTTPS traffic from https://0.0.0.0:443 to http://127.0.0.1:8000. For now, you need to ensure that ssl-proxy can bind port :443 and that mydomain.com routes to the server running ssl-proxy (as you may have expected, this is not the tool you should be using if you have load-balancing over multiple servers or other deployment configurations).

Provide your own certs

ssl-proxy -cert cert.pem -key myKey.pem -from 0.0.0.0:4430 -to 127.0.0.1:8000

You can provide your own existing certs, of course. Jenkins still has issues serving the fullchain certs from letsencrypt properly, so this tool has come in handy for me there.

Redirect HTTP -> HTTPS

Simply include the -redirectHTTP flag when running the program.

Installation

Simply download and uncompress the proper prebuilt binary for your system from the releases tab. Then, add the binary to your path or start using it locally (./ssl-proxy).

If you're using wget, you can fetch and uncompress the right binary for your OS using getbin.io as follows:

wget -qO- "https://getbin.io/suyashkumar/ssl-proxy" | tar xvz 

or with curl (note you need to provide your os if using curl as one of (darwin, windows, linux) below):

curl -LJ "https://getbin.io/suyashkumar/ssl-proxy?os=linux" | tar xvz 

Shameless plug: suyashkumar/getbin (https://getbin.io) is a general tool that can fetch the latest binaries from GitHub releases for your OS. Check it out :).

Build from source

Build from source using Docker

You can build ssl-proxy for all platforms quickly using the included Docker configurations.

If you have docker-compose installed:

docker-compose -f docker-compose.build.yml up

will build linux, osx, and darwin binaries (x86) and place them in a build/ folder in your current working directory.

Build from source locally

You must have Golang installed on your system along with make and dep. Then simply clone the repository and run make.

Attribution

Icons made by Those Icons from www.flaticon.com is licensed by CC 3.0 BY

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.