Giter Club home page Giter Club logo

mkssl's Introduction

#Creating a Certificate Authority and Certificates with OpenSSL Michaël Bekaert

##Summary This was written using OpenSSL 0.9.5 as a reference.

To start with, you'll need OpenSSL. Compilation and installation follow the usual methods. It's worthwhile to note that the default installs everything in /usr/local/ssl. No need to change this (unless you want to).

After you have this installed, you may want to edit the OpenSSL configuration file with the information for your site so you have pleasant defaults when creating and signing certificates. You'll find this in /usr/local/ssl/openssl.cnf in the section req_distinguished_name Here you can set the defaults (denoted by the _default appended to the variable name). Any settings that do not have a default, such as localityName can have one set by appending _default. In this case you'd set localityName_default.

Now, we move on to creating a private Certificate Authority (CA). The CA is used in SSL to verify the authenticity of a given certificate. The CA acts as a trusted third party who has authenticated the user of the signed certificate as being who they say. The certificate is signed by the CA, and if the client trusts the CA, it will trust your certificate. For use within your organisation, a private CA will probably serve your needs. However, if you intend use your certificates for a public service, you should probably obtain a certificate from a known CA. In addition to identification, your certificate is also used for encryption.

##Creating a private CA

  • Download the script call mkca.sh
  • su to root
    • To make sure you data are safe from evil eyes.
  • ./mkca.sh
    • It will create a 4096-bit self-sign CA certificate and key
    • When prompted for CA password, choose a long and safe password. This is your CA after all.
    • Answer the rest of the questions intelligently. The common name would be how this certificate might be referred to. For example, the Equifax Secure CA uses the common name of Equifax Secure Certificate Authority.
  • A .mkca.serial will also be created, that is the memory of the future server and client serial numbers.

##Creating server certificates

  • Download the script call mkserver.sh
  • su to root
    • To make sure you data are safe from evil eyes.
  • ./mkserver.sh
    • It will create a 4096-bit CA sign certificate and key
    • Answer the rest of the questions intelligently. The common name would be how this certificate might be referred to. For example, the server DNS e.g. www.example.com.
    • It will ask for a P12 pass phrase, that's the passphrase you set your key importation.
    • This signs the certificate that you just created with the CA you created just moments before. You can generate multiple certificates.
  • The signed certificate is now in the current directory as .crt + .key, .p12 and .pem. If you are going to create more, you should rename this.

##Creating client-side certificates

  • Download the script call mkclient.sh
  • su to root
    • To make sure you data are safe from evil eyes.
  • ./mkclient.sh
    • It will create a 4096-bit CA sign certificate and key
    • When prompted for CA password, choose a long and safe password. This is your CA after all.
    • Answer the rest of the questions intelligently. The common name would be how this certificate might be referred to. For example, your username or email address.
  • The signed certificate is now in the current directory as .crt + .key, .p12 and .pem. If you are going to create more, you should rename this.

mkssl's People

Contributors

mbekaert avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  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.