Join our Newsletter — 33% off our NHI Course
Home› Guides› OpenSSL for Beginners: The Commands Every Security Learner…
Guide Network Security

OpenSSL for Beginners: The Commands Every Security Learner Should Know

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 11 min read
On this page

OpenSSL is a free toolkit for checking, creating and testing the keys and certificates behind secure connections.

This guide is for students, new IT staff and curious learners who keep seeing OpenSSL commands in tutorials. You do not need to be a programmer: a few read-only commands can tell you a lot about a website's padlock.

In short

  • OpenSSL is both a code library that other software builds on and a command-line tool you type into.
  • Learners mostly use it to read a certificate, test a secure connection and make a practice key.
  • Its test connection tool keeps going after certificate errors, so read the warnings it prints.
  • Private keys you create are secrets. Keep them out of shared folders, chats and code.

What you will learn

  • Explain what OpenSSL is in one sentence.
  • Read who a certificate belongs to, who signed it and when it expires.
  • Spot the difference between what a server sends and what has been checked.
  • Handle a practice private key safely.
Website ID card (certificate)
a small file that says who a website is, signed by an organisation that vouches for it.
Secret half of a key pair (private key)
the part of a key pair that must stay with its owner and never be shared.
Text window for commands (command line)
a window where you type instructions to the computer instead of clicking.

What is OpenSSL?

Think of a locksmith's toolkit. It holds tools to inspect a lock, test a key and cut a new one. OpenSSL is that kind of toolkit for the locks on secure internet connections.

The project calls OpenSSL a toolkit for cryptography and secure communication. Cryptography is the maths of keeping data secret.[4] It comes in two forms. One is a library, a block of ready-made code that other programs use to protect their connections. The other is the openssl command, which you type into a command line.

The command has many smaller tools inside it. Each one has a name, such as x509 for certificates, s_client for test connections and genpkey for making keys.[1]

Where the comparison stops working: a locksmith needs years of training to use every tool. With OpenSSL, a handful of read-only commands covers most of what a learner needs. They are not meant to change the server you look at.

Why does it matter?

Many websites, apps and devices rely on the OpenSSL library to protect their connections. Learning the command gives you a direct way to see what those connections are made of.

If you are studying for a security course

What could happen: labs and exams ask you to read a certificate, and the screen of text looks like noise.

Check this: practise reading the subject, issuer and dates lines first.

Next: Public Key Infrastructure for Beginners

If you are new to a help desk or IT team

What could happen: a user reports a browser warning and you cannot tell if the certificate has expired.

Check this: look at the expiry date the server is really sending.

Next: Certificate Errors for Beginners

If you are building a home lab

What could happen: a practice private key ends up in a shared project, and people copy it into real systems.

Check this: keep practice keys in a folder only you can read, and label them as test only.

Next: Cyber Security Home Labs for Beginners

What does it look like?

Here is the kind of short summary OpenSSL prints when you ask it for the main facts about a certificate. The site and the organisations are made up.

Example only. All values are made up.

subject=CN = shop.example.com                       (1)
issuer=C = XX, O = Example Trust CA, CN = Example CA 1   (2)
notBefore=Mar  1 00:00:00 2026 GMT                  (3)
notAfter=May 30 23:59:59 2026 GMT                   (4)
  1. Who the certificate is for. In a real file, this line would contain the website's name.
  2. Who signed it. In a real file, this line would name the certificate authority that vouches for the site.
  3. The first day the certificate is valid.
  4. The last day it is valid. After this, browsers are likely to show a warning.

Why this is risky: a glance at the padlock tells you little. You can miss that a certificate is about to expire. You can also miss that it belongs to a different name. These four lines show both.[3]

The safer way: check the name and the end date whenever a site gives a warning. Keep expiry dates in a shared calendar or tracking tool.

How does it work?

Most learners use three tools inside OpenSSL. Here is what each one does, in the order you are likely to meet them.

  1. Read a certificate. The x509 tool prints certificate details. With -noout it hides the coded file itself. Options such as -subject, -issuer and -dates pick which facts to show. -text prints everything, including the public key.[3]
  2. Test a connection. The s_client tool connects to a server the way a browser would and shows what happens. The OpenSSL manual calls it a very useful diagnostic tool.[2] You give it the address with -connect, for example shop.example.com:443.
  3. Name the site you want. One server can host many websites. The -servername option tells it which site you mean, so you get the right certificate.[2]
  4. See what was sent. -showcerts lists every certificate the server sends. The manual warns this is not a verified chain: it shows what was sent, not what was checked.[2]
  5. Make a practice key. The genpkey tool creates private keys, and req creates a certificate request (a form you send to a certificate authority).[1]
Diagram titled Three OpenSSL jobs for learners. Three columns. Column 1, Read a certificate: a certificate file goes into the x509 tool, which prints who it is for, who signed it and the start and end dates. Column 2, Test a connection: your computer running s_client connects to a website server on port 443, the server sends its certificates back, and a warning box says shown is not the same as checked. Column 3, Make a practice key: genpkey creates a private key, shown with a padlock and the label keep secret, and req turns it into a certificate request sent to a certificate authority.
Figure 1. The three jobs most learners use OpenSSL for: read, test and make.

One point surprises many learners. s_client is built for troubleshooting, so it carries on even when a certificate fails its checks. The manual says normal applications should not do this, because it leaves them open to someone listening in the middle.[2] So a connection that "works" in s_client may still show a verify error in its output. Read that line.

Before and after diagram titled Connected is not the same as trusted. Left panel, labelled Easy to miss: the s_client output shows Connected at the top in large text, and lower down a small line reads Verify return code: certificate has expired, with an arrow saying the connection still opened. Right panel, labelled Safer habit: the reader looks for the verify line first, checks that it reports OK, and then checks the name and end date. A green bar says read the verify line before trusting the result.
Figure 2. A test connection can open even when the certificate fails its checks, so read the verify line.

A worked example

Vida Mbeki is in her first month on the IT help desk at a fictional college. On Monday morning, three students email to say the college's course booking site shows a browser warning.

Vida's team lead, Zane Achterberg, suggests she start with the facts, not guesses. She opens a command line on her work laptop and runs s_client against the booking site's address, adding -servername with the site's name.

The screen fills with text. Near the top, she sees the word "connected", and for a moment she thinks the site is fine. Then she remembers the locksmith's toolkit. Opening a lock is not the same as checking the key is genuine. She scrolls down and finds the verify line. It reports that the certificate has expired.

To be sure, she saves the certificate the server sent and reads it with x509, asking only for the subject, issuer and dates. The name matches the booking site. The end date was last Saturday.

Vida writes a short ticket for the web team: the site name, the end date and the exact error. She does not try to fix the server herself, because she has no access to it and it is not her job.

The web team renews the certificate within the hour. Vida checks again, and the verify line now reports OK. Zane asks her to add the new end date to the team's renewal calendar, so the warning does not catch them out next time.

Myths and mistakes

What people thinkWhat is true
If s_client says connected, the certificate is fine.It keeps going after certificate errors. Check the verify line in the output.[2]
-showcerts shows a checked, trusted chain.It shows what the server sent, in the order sent. It is not a verified chain.[2]
OpenSSL is only for experts.A few read-only commands, such as reading a certificate's dates, are a good first step for learners.
A practice key is harmless, so it can go anywhere.Practice keys get copied into real systems. Treat every private key as a secret.
OpenSSL and SSL are the same thing.SSL is an old connection protocol. OpenSSL is a toolkit that also supports its successor, TLS.[2]

What can I do this week?

  • Check whether OpenSSL is on your computer, or ask your IT team for a lab machine that has it.
  • Read the subject, issuer and dates of one certificate from a site you use.
  • Run one test connection and find the verify line in the output.
  • Make a practice key in a private folder, and delete it when you finish the exercise.
  • Read the official OpenSSL manual page for one tool you used.

Checklist

  • I can explain the difference between the OpenSSL library and the openssl command.
  • I can read who a certificate is for, who signed it and when it expires.
  • I use -servername when I test a site that may share a server with others.
  • I read the verify line before trusting any test connection.
  • I know -showcerts shows what was sent, not what was checked.
  • I keep private keys out of shared folders, chats, tickets and code.
  • I only test systems I own or have permission to test.

Common questions

Is OpenSSL safe to use?

Yes, for reading certificates and testing connections, as long as you keep it updated. The project publishes a list of known vulnerabilities and the releases that fix them.[4] Install it from your operating system's normal updates or the official project, not from a random download site.

Do I need permission to test a website with OpenSSL?

For a simple look at a public site's certificate, you are doing what a browser does. We suggest you still only run repeated or in-depth tests on systems you own or have written permission to test. Scanning other people's systems can break their rules or the law.

What is the difference between OpenSSL and a TLS scanner?

OpenSSL gives you single tools you drive yourself, one command at a time. A TLS scanner runs many checks in one go and writes a report. Learning OpenSSL first helps you understand what the scanner's report means.

Why does OpenSSL show a different certificate from my browser?

Often because the server hosts several sites. It did not know which one you meant. Add -servername with the site's name and try again. Some work networks check secure traffic. They can swap in their own certificate.

Can I use OpenSSL to make a certificate for my website?

You can make a key and a certificate request, and you can make a self-signed certificate for a lab. For a public website, browsers expect a certificate from a trusted certificate authority. Free automatic services exist for this.

Where next?

Ready for the detail? Read the practitioner guide: OpenSSL for Security Teams. It goes further into diagnosing chain and name errors, safe deployment and the hardening value of OpenSSL checks.

Also useful:

Related NHI Mgmt Group resources: Machine Identities and Certificates for Beginners · Public Key Cryptography for Beginners · Free Automatic TLS Certificates for Beginners

Key terms

OpenSSL
A free toolkit and code library for cryptography and secure connections.
TLS
The method that protects data travelling between your device and a website.
Digital certificate
A signed file that links a name, such as a website, to a public key.
Certificate authority
An organisation trusted to check and sign certificates.
Private key
The secret half of a key pair, kept only by its owner.
Certificate signing request
A form, made with your key, that asks a certificate authority for a certificate.
SNI
The part of a connection that tells a shared server which website you want.

Sources and further reading

  1. openssl: OpenSSL command line program (OpenSSL 3.0 manual). OpenSSL Project. https://docs.openssl.org/3.0/man1/openssl/, accessed 28 Nov 2026.
  2. openssl-s_client: SSL/TLS client program (OpenSSL 3.0 manual). OpenSSL Project. https://docs.openssl.org/3.0/man1/openssl-s_client/, accessed 28 Nov 2026.
  3. openssl-x509: certificate display and signing command (OpenSSL 3.0 manual). OpenSSL Project. https://docs.openssl.org/3.0/man1/openssl-x509/, accessed 28 Nov 2026.
  4. OpenSSL Library home page. OpenSSL Foundation and OpenSSL Corporation. https://openssl-library.org/, accessed 28 Nov 2026.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.