Securing communication on FreeBSD: creating certificates with openssl, managing the trust store with ca_root_nss, and comparing the base openssl vs LibreSSL. You will also harden SSH with ed25519, create keys with ssh-keygen, and use tunneling for secure access.

In the previous episode 13, you mastered IPFW and packet analysis. Now we turn to the transport security layer: encryption, certificates, and secure remote access. Without this, all the firewalls in the world won't protect data traveling in plain text across the network. This episode covers certificate creation, trust store management, hardening SSH with ed25519 keys, and SSH tunneling.
FreeBSD ships OpenSSL as part of the base system. This version is maintained specifically by the FreeBSD team with attention to security and compatibility. Check its version:
openssl versionFor those who want an alternative version, LibreSSL (a fork of OpenSSL by OpenBSD) is available as a port. The comparison:
| Aspect | Base OpenSSL | LibreSSL |
|---|---|---|
| Origin | FreeBSD base system | Separate package |
| Maturity | High, maintained by FreeBSD team | High, OpenBSD style |
| Compatibility | Comprehensive | Very good |
| Best for | Default on all systems | Specific needs |
Info
For most systems, use the OpenSSL that ships with the base system. LibreSSL is useful when you want to avoid deprecated APIs or need more conservative, OpenBSD-style behavior.
The standard flow: create a private key, then a Certificate Signing Request (CSR):
openssl req -newkey rsa:2048 -nodes -keyout server.key -out server.csrFor internal testing, create a self-signed certificate:
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout server.key -out server.crtSelf-signed certificates are not trusted by browsers or other clients automatically — you have to add them to the trust store manually.
openssl verify -CAfile ca.crt server.crt
openssl x509 -in server.crt -noout -textpkg install ca_root_nsscertctl list
certctl rehashcertctl is the modern tool for managing FreeBSD's trust store. certctl rehash rebuilds the certificate hashes in /etc/ssl.
Success
After installing ca_root_nss and running certctl rehash, CLI applications like curl and fetch will trust sites with public CA certificates — important for pkg and freebsd-update, which run automatically.
cp corp-ca.crt /etc/ssl/certs/corp-ca.crt
certctl rehashed25519 keys are the modern choice — fast and secure:
ssh-keygen -t ed25519 -C "user@host"
ssh-copy-id user@serverEdit /etc/ssh/sshd_config to lock down access:
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
KbdInteractiveAuthentication noDanger
Disable PasswordAuthentication only after you're sure the public key is installed and you can log in. Otherwise you'll lock yourself out. Test from an already-open SSH session before reloading sshd.
HostKey /etc/ssh/ssh_host_ed25519_keysshd -t
service sshd restartSSH tunneling carries traffic through an encrypted connection. Example: access an internal service from your machine:
ssh -L 8080:internal-host:80 user@gatewayA SOCKS proxy makes your machine "exist" on the remote network:
ssh -D 1080 user@gatewayWarning
SSH tunneling gets through firewalls in a legitimate way, but make sure your network policy allows it. In a corporate environment, unauthorized tunnels are a common security audit finding.
ca_root_nss and run certctl rehash periodically.pkg upgrade and freebsd-update.openssl version
ssh -V
service sshd status
certctl list | wc -lIn this episode 14, you covered OpenSSL and TLS on FreeBSD: creating certificates with openssl req, verification, trust store management with ca_root_nss and certctl, hardening SSH with ed25519 and a secure sshd_config, and tunneling for secure remote access.
Key takeaways:
ca_root_nss and rehash the trust store so clients trust public CAs.sshd -t before restarting; SSH tunneling secures internal access.