• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • PKI Training
  • OpenSSL
  • Keytool
  • PKI Tools
    • Apereo CAS
    • SAML
    • OpenID Connect
  • Get expert help

SSL/TLS Certificates – Getting Started

January 30, 2019 by Mister PKI Leave a Comment

What is a self-signed certificate?

Self-signed certificates are SSL/TLS certificates generated and signed by you, not a Certification Authority (CA) certificate. Self-signed certificates should not be used on a publicly facing web application, but for local testing purposes, it does the trick.

Why can I not use a certificate issued by a CA?

You can. If your development server has a registered name in DNS and you can do Domain Validation (DV) for a CA, then this route is perfectly acceptable. You can either purchase an SSL/TLS certificate from a CA or get a certificate from Let’s Encrypt for free.

If those two questions confuse you, you may be asking:

What the heck is a digital certificate to begin with?

A digital certificate is a credential which contains your public key given to a client to encrypt data coming to your server. You then decrypt that data with your corresponding private key. In addition to your public key, a digital certificate contains other attributes such as a validity period, expiration date, etc that we will not get into for the purposes of this article.

How do I generate self-signed SSL/TLS certificates?

Using openssl on Linux, use the following command:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj '/CN=localhost' -nodes

Let me break down what this means:
openssl – the openssl cryptography toolkit
req -x509 – request a self-signed X509 certificate
-newkey rsa:4096 – creates a new private key with 4096 bits.
-keyout – the file to contain your private key
-out – the file to contain your self-signed certificate
-days 365 – the validity period of your self-signed certificate in days.
-subj '/CN=localhost' – The subject DN of your certificate. If running a local development environment, this isn’t overly important but can save you the annoyance of browser warnings. If you’re not using localhost, put the fully qualified domain name (FQDN) here in place of localhost.
-nodes – No encryption of the private key. This is fine for a local development environment.

Hopefully, this helps get you started with using SSL/TLS. Please leave a comment asking for more explanation and if you are interested in a detailed description of how to install certificates on your web server. For example Apache, Tomcat, Jetty, etc.

Read all blog content.

SSL Certificates

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

PKI for DevOps Engineers – Free Training Series

PKI for DevOps Training Hub

Lesson 1 – How TLS and PKI Work

Lesson 2 – Understanding X.509 Certificates

Lesson 3 – Certificate Chains Explained

Lesson 4 – Debug TLS with OpenSSL

Lesson 5 – Verify Certificate Chains

Lesson 6 – Creating CSRs with OpenSSL

Lesson 7 – Working with PKCS12 Certificates

Lesson 8 – Java Keystores and keytool

Lesson 9 – Certificate Expiration Monitoring

Lesson 10 – Automating Certificate Renewal

Lesson 11 – Common TLS Errors

Lesson 12 – PKI Architecture for DevOps

Recent Posts

  • Apache mod_auth_cas: Protect Web Applications with Apereo CAS and Docker
  • Apache mod_auth_mellon: Configure SAML SSO & Docker
  • Configure OpenID Connect (OIDC) in Apereo CAS 7.3 and 8
  • Certificate Ownership Is an Operating Model Problem, Not a Tooling Problem
  • OpenSSL dgst: Create Checksums and Verify Digital Signatures

Footer

  • Twitter
  • YouTube
Mister PKI

Practical security engineering for the systems that establish trust.

Learn OpenSSL Keytool Free training
Work together PKI consulting CAS consulting Sponsored contributions
Site About Support Mister PKI Cookie policy Search
© 2026 Mister PKI Secure systems. Clear guidance.