Giter Site home page Giter Site logo

simple-https-server's Introduction

Simple HTTPS Server with mTLS

A Python-based HTTPS server that supports Mutual TLS (mTLS). This simple server can be used for a variety of applications, such as Vault PKI demonstrations, running a secure internal web service, or for ethical hacking practices for certifications like OSCP or CEH.

Prerequisites

  • Python 3.x
  • OpenSSL (For generating certificates and keys)

Features

  • Supports HTTPS using TLS
  • Supports mTLS for client verification
  • Customizable IP and port
  • Utilizes Python's http.server and ssl modules

Usage

To run the server, execute the following command:

Simple HTTPS Server listening on 127.0.0.1:8443

python3 server.py -p 8443 -c server.crt -k server.key -a ca.crt

Simple HTTPS Server listening on 0.0.0.0:8443 with mTLS enabled

python3 server.py -p 8443 -l 0.0.0.0 -c server.crt -k server.key -a ca.crt -m

To test the server using curl, execute the following command:

curl -k --cert client.crt --key client.key https://127.0.0.1:8443

Switches

  • -p, --port: The port to listen on. E.g. 8443
  • -l, --listen: The IP address to listen on (defaults to 127.0.0.1 if this is omitted). E.g. 0.0.0.0
  • -c, --certfile: The server certificate file. This is the public certificate that the server presents during the handshake.
  • -k, --keyfile: The server private key file. This private key corresponds to the public certificate specified in --certfile.
  • -a, --cafile: The CA certificate file for client verification. This is the CA that signed the client's certificate.
  • -m, --mtls: Enables mTLS, which will require the client to provide a valid certificate.

Examples of Use Cases

  • Vault PKI Demo: You can use this server to demonstrate how Vault can issue certificates. Use the CA certificate from Vault as ca.crt, and Vault-issued certificates as server.crt and server.key.
  • Ethical Hacking: This setup can be used to practice mTLS and SSL exploitation techniques in a controlled environment. Useful for certifications like OSCP or CEH.
  • Secure Internal Web Services: Use this as a simple HTTPS server with client verification for running secure internal web services.

simple-https-server's People

Stargazers

 avatar

Watchers

 avatar

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.