A NAS on a home network, a self-signed certificate, and curl refusing to connect with SSL certificate problem: self-signed certificate. Every device that talks to that NAS will say the same thing until it is told to trust that one certificate, and the next service on the network starts the whole problem over. The fix that actually holds up is a small one-time step: create a private certificate authority (CA), trust it once on each device, and sign every home-lab certificate with it. The commands below were run with OpenSSL against nginx test servers, and every error message shown is the real output.
Why a self-signed certificate keeps failing
What “self-signed” means
Every TLS certificate is signed by an issuer, and clients trust it only if they can trace that signature back to a root certificate already in their trust store. A self-signed certificate is its own issuer. One command makes one:
openssl req -x509 -newkey rsa:2048 -nodes -keyout self.key -out self.crt \
-days 365 -subj "/CN=nas.home.arpa"
What clients do with it
openssl verify self.crt answered error 18 at 0 depth lookup: self-signed certificate. curl gave the same verdict against an nginx server using it:
curl: (60) SSL certificate problem: self-signed certificate
The only quick fix is curl -k, which turned off verification and returned the page. That also turns off the protection HTTPS exists to provide: the connection is encrypted, but nothing confirms who is on the other end.
Why trusting each certificate doesn’t scale
A self-signed certificate can be added to a trust store directly, but then every new device or service means a new certificate to install on every client, and every renewal repeats it. A CA turns that into one install per client, ever.

Building the CA
The CA key and certificate
openssl genrsa -out ca.key 4096
openssl req -x509 -new -key ca.key -sha256 -days 3650 -out ca.crt \
-subj "/CN=Home Lab Root CA" \
-addext "basicConstraints=critical,CA:TRUE" \
-addext "keyUsage=critical,keyCertSign,cRLSign"
The two extensions mark this certificate as a CA. RFC 5280, the standard for internet X.509 certificates, says the keyCertSign bit “is asserted when the subject public key is used for verifying signatures on public key certificates,” and requires the CA flag in basic constraints whenever it is.
Guarding the CA key
ca.key can sign a certificate for any name, including real websites, and every device that trusts the CA will accept it. It belongs on an offline machine or an encrypted drive, not on the NAS or web server it certifies. The ten-year lifetime above is a convenience for a home lab; a leaked CA key is a ten-year problem.
Naming the network
The examples use nas.home.arpa. RFC 8375, published in May 2018, set aside that domain: “‘home.arpa.’ is designated for non-unique use in residential home networks.” Using it avoids made-up suffixes like .local, which has its own meaning for multicast DNS, or .lan, which isn’t reserved for anything.
Signing a server certificate
Key, request, extensions
openssl genrsa -out nas.key 2048
openssl req -new -key nas.key -out nas.csr -subj "/CN=nas.home.arpa"
The extensions go in a small file, nas.ext:
basicConstraints=CA:FALSE
keyUsage=critical,digitalSignature,keyEncipherment
extendedKeyUsage=serverAuth
subjectAltName=DNS:nas.home.arpa,IP:127.0.0.1
Signing
openssl x509 -req -in nas.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
-out nas.crt -days 397 -sha256 -extfile nas.ext
openssl verify -CAfile ca.crt nas.crt printed nas.crt: OK. Inspecting it showed the issuer and names:
subject=CN = nas.home.arpa
issuer=CN = Home Lab Root CA
X509v3 Subject Alternative Name:
DNS:nas.home.arpa, IP Address:127.0.0.1
Why the IP address is in there
Connecting to https://127.0.0.1:8444/ only verified because the address was listed in the subject alternative name. Devices reached by IP need their IP in the certificate, and a DHCP lease that changes will break it, which is one more reason to use names.

Testing it against a real server
Three servers, one client
Three nginx servers ran side by side: one with the self-signed certificate, one with the CA-signed certificate, and one CA-signed certificate with no subject alternative name at all. curl connected to each by name, with and without the CA:
| Server certificate | curl, no CA given | curl --cacert ca.crt |
|---|---|---|
| Self-signed | self-signed certificate | self-signed certificate |
| CA-signed, with SAN | unable to get local issuer certificate | OK |
| CA-signed, no SAN | unable to get local issuer certificate | OK |
Reading the errors
“Self-signed certificate” means the server’s certificate is its own issuer and isn’t trusted. “Unable to get local issuer certificate” means the certificate was signed by a CA the client doesn’t know. Those are different problems: the second goes away once the client trusts the CA.
The wrong name
With the CA trusted, connecting under a name the certificate doesn’t list still failed:
curl: (60) SSL: no alternative certificate subject name matches target host name 'nas2.home.arpa'
The certificate proves identity for the names it contains, nothing else.
Adding an intermediate CA, and the chain the server must send
Why bother with a second CA
Larger setups keep the root key completely offline and sign day-to-day certificates with an intermediate CA instead. The root signs the intermediate once; if the intermediate key is ever exposed, it can be replaced without reinstalling anything on clients. In the test, the intermediate got basicConstraints=critical,CA:TRUE,pathlen:0, where pathlen:0 stops it from creating further CAs beneath itself, and it signed a 90-day certificate for web.home.arpa.
The missing-chain error
Clients trust only the root, so the server has to hand over the intermediate along with its own certificate. Two nginx servers used the same 90-day certificate, one configured with the certificate alone and one with the certificate followed by the intermediate in a single file:
cat web.crt int.crt > web-fullchain.crt
With the root CA trusted, the first server still failed with unable to get local issuer certificate, the same message as an untrusted CA. The full-chain server returned its page. The error text doesn’t say “missing intermediate,” which is why this one costs people time.
Checking expiry before it bites
Short-lived certificates mean renewals, and OpenSSL can warn ahead of time. openssl x509 -in web.crt -noout -checkend 2592000 checks whether a certificate expires within the next 30 days (2,592,000 seconds). For the 90-day certificate it printed Certificate will not expire; with a 100-day window it printed Certificate will expire and exited with an error code, which makes it easy to use in a scheduled script that sends a reminder.

The subjectAltName rule browsers enforce
curl accepted the no-SAN certificate; browsers won’t
The third row in the table is a trap. curl, built on OpenSSL, accepted a certificate whose only name was in the common name (CN) field. Browsers stopped doing that years ago. The Chrome Platform Status entry for “Support for commonName matching in Certificates” lists it as removed in Chrome 58, and notes that Firefox removed support in Firefox 48.
What the standard says now
RFC 9525, published in November 2023 to update how TLS clients check server identity, is blunt: “The Common Name RDN MUST NOT be used to identify a service because it is not strongly typed.” A certificate tested only with curl can look fine and then fail in every browser.
The habit that avoids it
Every server certificate gets a subjectAltName with every name and address clients will use. The CN can stay as a readable label, but nothing should depend on it.
Trusting the CA on each device
Linux (Debian and Ubuntu)
The update-ca-certificates manual page explains that certificates with a .crt extension under /usr/local/share/ca-certificates are included as implicitly trusted, and that the tool rebuilds the bundle at /etc/ssl/certs/ca-certificates.crt:
sudo cp ca.crt /usr/local/share/ca-certificates/homelab-root-ca.crt
sudo update-ca-certificates
After that, plain curl https://nas.home.arpa:8444/ returned ca-signed ok with no --cacert flag, and Python’s urllib connected without its earlier CERTIFICATE_VERIFY_FAILED error, because both read the system bundle on that machine.
Other systems and programs
Windows, macOS, phones and some browsers keep their own trust stores, so the CA certificate gets imported once into each. Some programs, such as Python environments with their own certificate bundle, ignore the system store and need to be pointed at ca.crt directly.
Checking the fingerprint before trusting
Importing a root certificate is a serious grant of trust, so the file that arrives on each device should be checked against the original. openssl x509 -in ca.crt -noout -fingerprint -sha256 prints a SHA-256 fingerprint, a long string of hex pairs that changes completely if a single byte of the certificate changes. Most operating systems show the same fingerprint in their certificate details screen during import, and comparing the two takes ten seconds. A copied file that doesn’t match shouldn’t be trusted.
Only the certificate travels
ca.crt is public and safe to copy to every device. ca.key never leaves its safe place. Renewing a server certificate later is the signing step again, and no client needs to change anything.
Sources
- RFC 5280, Internet X.509 Public Key Infrastructure Certificate and CRL Profile, RFC Editor: https://www.rfc-editor.org/rfc/rfc5280
- RFC 8375, Special-Use Domain ‘home.arpa.’ (May 2018), RFC Editor: https://www.rfc-editor.org/rfc/rfc8375
- RFC 9525, Service Identity in TLS (November 2023), RFC Editor: https://www.rfc-editor.org/rfc/rfc9525
- Support for commonName matching in Certificates, Chrome Platform Status: https://chromestatus.com/feature/4981025180483584
- update-ca-certificates(8), Debian manual pages: https://manpages.debian.org/bookworm/ca-certificates/update-ca-certificates.8.en.html
