Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

OpenSSL gives you the command-line workflow for creating private keys, generating PKCS#10 certificate signing requests (CSRs), producing test certificates, inspecting X.509 data, checking certificate validity and packaging credentials for servers. A safe production workflow is: create and protect a key, generate a CSR with the correct Subject Alternative Names (SANs), obtain a certificate from a trusted certificate authority (CA), verify the certificate and chain, convert it to the format your software requires, then deploy it without exposing the key.

This guide uses commands that work across common OpenSSL 1.1.1 and 3.x installations, while calling out defaults that changed in OpenSSL 3.2 and 3.3. Run openssl version -a first and record the result with your command options so a renewal can be reproduced.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What OpenSSL handles in a certificate workflow

The OpenSSL project describes itself as “a cryptography toolkit implementing the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) network protocols and related cryptography standards required for them.” In day-to-day certificate work, that means one toolkit can create keys, build PKCS#10 requests, create test certificates, parse X.509 fields, verify signatures and chains, and convert between common encodings.

A CSR contains a public key and identifying information, signed with the corresponding private key. It does not contain the private key. When a CA signs the request, the CA places that public key and approved subject information into an X.509 certificate. A self-signed certificate skips the CA and is signed by its own key, which is useful for controlled testing but is not automatically trusted by public browsers.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
  1. Generate a new private key or select an existing one.
  2. Create a CSR with the names and other subject information the certificate must cover.
  3. Submit the CSR to a CA, or self-sign only for a lab, internal test, or private trust domain.
  4. Inspect the resulting certificate, including dates, issuer, SANs, key usage and public key.
  5. Verify the chain and hostname with appropriate trust material.
  6. Convert and deploy the certificate, intermediates and private key in the format required by the server or client.

Check the OpenSSL release before relying on defaults

OpenSSL options and defaults are release-sensitive. Capture the version and build details with:

openssl version -a

Since OpenSSL 3.2, certificates generated by req are X.509 version 3 unless you explicitly request -x509v1; key-identifier extensions are included by default. Since OpenSSL 3.3, a failed req -verify check exits with status 1, which matters in scripts that test the command result. The spelling -noenc is the current option for leaving a generated private key unencrypted; the older -nodes spelling is deprecated in OpenSSL 3.0. Check the local man page when moving between 1.1.1, 3.x and later releases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generate a private key and CSR

Create a key and CSR in one command

This is the shortest interactive workflow for an RSA key:

openssl req -newkey rsa:2048 -keyout private.key -out request.csr

OpenSSL creates the private key and then asks for the CSR subject fields. By default, the generated key is protected with a passphrase. Keep that encryption when the service can securely supply the password at startup. If an appliance or unattended service cannot read an encrypted key, add -noenc deliberately and compensate with strict file permissions, host protection and a key-management process:

openssl req -newkey rsa:2048 -noenc -keyout private.key -out request.csr

An unencrypted key is a deployment choice, not a harmless convenience: anyone who obtains the file can use the identity represented by the certificate.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Create a CSR from an existing key

When a key already exists, generate a new request without replacing it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openssl req -new -key private.key -out request.csr

This is useful for renewal when policy permits key reuse, although generating a fresh key for a renewal limits the impact of an old key being exposed. The CA receives request.csr, never private.key.

Put modern hostnames in Subject Alternative Name

Modern TLS hostname validation uses SAN entries. Do not rely on a Common Name alone for every client. For repeatable requests, place the subject and SAN values in a configuration file rather than answering prompts:

[req]
distinguished_name = req_distinguished_name
req_extensions = req_ext
prompt = no

[req_distinguished_name]
C = US
ST = State
L = City
O = Example Operations
CN = www.example.com

[req_ext]
subjectAltName = @alt_names

[alt_names]
DNS.1 = www.example.com
DNS.2 = example.com

Save it as openssl.cnf, then run:

openssl req -new -key private.key -out request.csr -config openssl.cnf

Include every DNS name clients will actually use. A wildcard, an IP address and an internal name have different validation implications; list an IP under an IP SAN rather than pretending it is a DNS name. Confirm the final SAN list in the issued certificate instead of assuming the CA copied every requested value.

Use RSA or elliptic-curve keys intentionally

RSA is widely interoperable and the examples above use a 2048-bit RSA key. Elliptic-curve keys can provide comparable security with smaller keys, but support and operational procedures vary by server, library and policy. Generate the type your target software and CA support, then keep the same type documented for renewal.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Choice Operational trade-off
RSA Broad compatibility; the example uses rsa:2048.
Elliptic curve Smaller key material and modern cryptography, with compatibility to confirm before deployment.

Inspect and verify a CSR

Before submitting a request, inspect exactly what it contains and verify its self-signature:

openssl req -in request.csr -text -verify -noout

The text output lets you check the subject, public-key algorithm, requested extensions and SANs. The -verify operation checks that the CSR was signed by the private key corresponding to its public key; it does not prove that a CA will issue the names requested. In OpenSSL 3.3 and later, a failed check returns exit status 1, so automation can stop instead of submitting a bad request.

Create a self-signed certificate for testing

For a lab or an isolated private trust domain, create a key and self-signed X.509 certificate in one step:

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem

Use -noenc only when the test service cannot handle a passphrase-protected key. Set an explicit lifetime when your test should model a known expiry window:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openssl req -x509 -newkey rsa:2048 -days 365 -keyout key.pem -out cert.pem

A self-signed certificate can encrypt a connection, but clients must be configured to trust that certificate (or its private CA). Public HTTPS normally requires a certificate chaining to a CA already trusted by the client. Installing a self-signed leaf as a global trust anchor is a deliberate private-network policy, not a substitute for public trust.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Read an X.509 certificate with openssl x509

Display all encoded fields

openssl x509 -in cert.pem -text -noout

Use this output to inspect the subject, issuer, serial number, public-key algorithm, validity period, extensions, key-usage and extended-key-usage values, SANs and fingerprints. It shows what is encoded; it does not by itself establish that a client trusts the issuer or that a hostname matches.

Check dates, issuer and subject quickly

openssl x509 -in cert.pem -dates -issuer -subject -noout

This compact check catches a surprisingly common deployment error: installing a certificate whose validity has not started, has expired, or belongs to a different host or organization.

Test whether expiry is approaching

openssl x509 -in cert.pem -checkend 2592000 -noout

The argument is seconds. 2592000 is 30 days, so the command exits successfully when the certificate remains valid beyond that interval and fails when it expires sooner. Use the exit status in renewal monitoring rather than relying on a human reading the date.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect intended purposes

openssl x509 -in cert.pem -purpose -noout

Purpose output helps reveal certificates that are validly signed but lack the key-usage or extended-key-usage needed for a server, client or CA role.

Verify a chain and a hostname, not just the file syntax

Parsing a certificate proves that OpenSSL can decode it. Trust verification requires a trusted CA store and, when appropriate, intermediate certificates:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
openssl verify -CAfile root-ca.pem -untrusted intermediate.pem cert.pem

The leaf certificate is checked against the trusted root while the intermediate is supplied as an untrusted chain-building certificate. A successful result means the signature chain and relevant certificate constraints pass for that verification context; it does not automatically test every application-specific policy.

Where the installed OpenSSL version supports hostname verification, add the expected name:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openssl verify -CAfile ca-bundle.pem -verify_hostname www.example.com cert.pem

Hostname verification must use the name the client sends. A certificate for api.example.com is not automatically valid for www.example.com, even when both chains are trusted. Test the same chain and hostname rules your production client uses when possible.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Convert PEM, DER, PKCS#12 and PKCS#7 files

PEM is Base64 text with delimiters such as -----BEGIN CERTIFICATE-----. DER is the binary encoding of the same ASN.1 data. PKCS#12 (usually .p12 or .pfx) is a password-protected container that can hold a private key, leaf certificate and chain. PKCS#7 (often .p7b) carries certificates and, in some cases, a chain, but not a private key.

Task Command Result
PEM certificate to DER openssl x509 -in cert.pem -outform DER -out cert.der Binary DER certificate
DER certificate to PEM openssl x509 -inform DER -in cert.der -outform PEM -out cert.pem PEM certificate
Create a PKCS#12 bundle openssl pkcs12 -export -inkey private.key -in cert.pem -certfile chain.pem -out bundle.p12 Password-protected key, leaf and optional chain
Extract certificates from PKCS#12 openssl pkcs12 -in bundle.p12 -clcerts -nokeys -out cert.pem Leaf certificate in PEM form
Create PKCS#7 certificate bundle openssl crl2pkcs7 -nocrl -certfile cert.pem -out certs.p7b PKCS#7 bundle without a revocation list
Extract PEM certificates from PKCS#7 openssl pkcs7 -in certs.p7b -print_certs -out certs.pem Certificates printed as PEM

For a DER-encoded PKCS#7 file, add -inform DER to the pkcs7 command; to write DER, add -outform DER. PKCS#12 export prompts for a container password. Protect that password and the extracted key as separate secrets, and avoid leaving temporary unencrypted files in shared directories.

Diagnose common TLS certificate failures

Symptom Likely cause Fix
Hostname mismatch The requested name is absent from SANs or the client connected with a different name. Issue a certificate containing the exact DNS or IP SAN and verify with the name clients use.
“Unable to get local issuer” or similar chain error An intermediate is missing, in the wrong order, or the client lacks the correct trust anchor. Supply the complete leaf-to-intermediate chain and install or reference the intended root CA.
Not yet valid or expired The certificate dates do not cover the current time, or a system clock is wrong. Correct the clock and replace the certificate before its validity window closes.
Private key does not match certificate A different key was paired with the certificate during deployment. Compare the public key or modulus derived from both files and select the matching pair.
Unsupported format or “bad end line” The application expects DER, PEM, PKCS#12 or PKCS#7 different from the supplied file. Convert explicitly, preserve the PEM delimiters, and confirm the target software’s import setting.
Certificate rejected for purpose Key usage or extended key usage does not authorize the server, client or CA role. Inspect -purpose and request a certificate with the required usages.
Self-signed or unknown authority warning The certificate is not anchored in a CA trusted by the client. Use a publicly trusted certificate for public services, or distribute the private CA trust anchor to every controlled client.
Service cannot start after key installation The key is encrypted and the service has no password mechanism, or file permissions block its account. Configure secure password delivery, or use an unencrypted key only with compensating host controls and restrictive permissions.

Deploy and maintain certificates safely

  • Keep private keys out of tickets, chat, source control and general-purpose backups. Treat a leaked key as a compromised identity.
  • Restrict the key file to the account or secret-management process that needs it. Remove temporary extraction files after import.
  • Deploy the leaf certificate with the required intermediate chain. Do not assume clients can download missing intermediates.
  • Before restarting a service, inspect the certificate dates, issuer, SANs, key usage, public key and fingerprint.
  • Test both chain building and hostname verification against the same trust roots your clients use.
  • Record the OpenSSL version, configuration file, key algorithm, command options and certificate identifiers. That record makes renewals and incident response reproducible.
  • Monitor expiry with -checkend and begin replacement early enough to account for CA validation, approval and rollout time.

Choose the workflow that fits the environment

Decision Use this when Important caution
Self-signed Lab testing, temporary development or a controlled private trust domain Every client must explicitly trust it; public browsers will not normally do so.
CA-issued Public HTTPS or any service whose clients already trust the issuing hierarchy Validate the returned chain, SANs and usage before deployment.
Encrypted private key A service can retrieve a password securely at startup Password loss can prevent an automated restart; document recovery.
Unencrypted private key An appliance or service has no password support Use strict permissions, host hardening and secret-handling controls.
Interactive CSR One-off work where a human can review every prompt Prompt mistakes and omitted SANs are easy to miss.
Configuration-driven CSR Renewals, automation and repeatable infrastructure Review the configuration and generated CSR so stale names are not carried forward.
PEM Unix-like servers and software that accepts text certificates and keys Keep the BEGIN/END delimiters intact and protect key files.
DER, PKCS#12 or PKCS#7 Platforms that require binary certificates or a packaged import format PKCS#7 does not carry a private key; PKCS#12 does and must be password-protected.

A final pre-deployment checklist

  1. Run openssl version -a and save the version with the change record.
  2. Confirm the private key is the intended algorithm, is stored securely and is not present in the CSR submission.
  3. Run openssl req -in request.csr -text -verify -noout; check the subject and every SAN.
  4. Inspect the issued certificate with openssl x509 -in cert.pem -text -noout.
  5. Check -dates, issuer, key usage, extended key usage, fingerprint and public key.
  6. Run chain verification with the correct root and intermediate files, plus hostname verification where supported.
  7. Convert only after verification, then inspect the converted output and import it into the target service.
  8. Restart or reload the service using a controlled change, and test from a real client using the production hostname.
  9. Set an expiry alert and retain the exact commands and configuration needed for the next renewal.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.