Cryptography guides

Create one workshop test certificate for a name and loopback addresses

·

A local workshop site can be opened as workshop.test, localhost, or either loopback address. Put each identity in the certificate as a separate subject alternative name and inspect the saved certificate before using it in the test client.

Self-Signed Certificate Generator

Set the subject and four test identities

Select Load example to use ECDSA P-256, workshop.test and the organization Workshop, Studio. The sample includes two DNS names and two IP addresses. In the last line, IP: is the field prefix and ::1 is the IPv6 address.

Review Valid from and Valid until. Both controls use UTC, and the example spans 30 days. Generate the certificate, then compare the same subject and issuer shown with the fresh serial number and the four alternative names.

Alternative names to put in the certificate
DNS:workshop.test
DNS:localhost
IP:127.0.0.1
IP:::1

RFC 5280 — Basic certificate fieldsRFC 5280 — Subject alternative name

Check the signature and hostname in OpenSSL

Download certificate.pem. In a local folder, use the certificate as the explicit trust file for this OpenSSL verification command. The partial chain option lets this invocation trust the supplied leaf. The hostname verification uses workshop.test from the DNS entries. For a client that connects to 127.0.0.1, use -verify_ip 127.0.0.1 in place of the hostname option.

This command verifies the saved certificate for the test invocation. A different client needs its own explicit trust configuration.

Verify the certificate while its dates are valid
openssl verify -partial_chain -check_ss_sig -CAfile certificate.pem -purpose sslserver -verify_hostname workshop.test certificate.pem

OpenSSL — Verification optionsRFC 5280 — Subject alternative name

Compare another certificate issued from the same settings

Generate the example again. The subject, alternative names and selected dates stay the same. The serial number, key and SHA-256 fingerprint change.

Keep the certificate and the private key from the same generation together when configuring your local test server. Save the private file through the separate confirmation.

RFC 5280 — Basic certificate fields

Common questions

Can I put an HTTPS URL in a DNS entry?

Use the hostname alone, with no scheme, port, path or wildcard. Use an IP entry for a literal numeric address.

What can the certificate sign?

Its digital-signature key usage supports proving server key possession. Basic Constraints marks it as a leaf and its extended usage is TLS server authentication.

Sources

Put it into practice.

Related guides