Giter Site home page Giter Site logo

tls_sample's Introduction

TLS server/client sample with openssl

This is simple project that shows how to setup a TLS communication between server and client using openssl

Generate test Root CA and Certificates

I already generated rootca and the certificates for localhost in order to allow fast tests of the application. I also included the rootCA key in git in case you want to reuse it BUT remember: NEVER EVER PUBLISH THE rootCA KEY file. You can use the following bash snippets to generate your own certificates.

  • Generate the private key of the root CA: openssl genrsa -out rootCAKey.pem 2048
  • Generate random password for the certificate: openssl rand -hex 32 > password

Note that this snippet will generate a certificate for localhost. If you want to change domain replace localhost with the desired domain.

  • Generate the certificate key encrypted with the password in password: openssl genrsa -aes256 -passout pass:$(cat password) -out certificate.key 2048
  • Generate the public certificate for localhost: openssl req -new -days 3650 -x509 -key certificate.key -passin pass:$(cat password) -out certificate.pem -subj "/C=IT/ST=Italy/L=Milan/O=MazerFaker/OU=Engineering/CN=localhost"

If you have some issue with the certificates you can use this site to debug it.

Guides

tls_sample's People

Contributors

macsimbodnar avatar

Stargazers

 avatar  avatar Marcos Antonio Maceo avatar

Watchers

James Cloos avatar  avatar

Forkers

stdevmac

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.