SPDX-License-Identifier: BSD-2-Clause

Copyright 2018 Allan Jude <allanjude@freebsd.org>

Redistribution and use in source and binary forms, with or without
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

.Dd October 10, 2023 .Dt CERTCTL 8 .Os .Sh NAME .Nm certctl .Nd "tool for managing trusted and untrusted TLS certificates" .Sh SYNOPSIS .Nm .Op Fl v c list .Nm .Op Fl v c untrusted .Nm .Op Fl nUv .Op Fl D Ar destdir .Op Fl M Ar metalog c rehash .Nm .Op Fl nv c untrust Ar file .Nm .Op Fl nv c trust Ar file .Sh DESCRIPTION The .Nm utility manages the list of TLS Certificate Authorities that are trusted by applications that use OpenSSL.

p Flags: l -tag -width 4n t Fl D Ar destdir Specify the DESTDIR (overriding values from the environment). t Fl d Ar distbase Specify the DISTBASE (overriding values from the environment). t Fl M Ar metalog Specify the path of the METALOG file (default: $DESTDIR/METALOG). t Fl n No-Op mode, do not actually perform any actions. t Fl v Be verbose, print details about actions before performing them. t Fl U Unprivileged mode, do not change the ownership of created links. Do record the ownership in the METALOG file. .El

p Primary command functions: l -tag -width untrusted t Ic list List all currently trusted certificate authorities. t Ic untrusted List all currently untrusted certificates. t Ic rehash Rebuild the list of trusted certificate authorities by scanning all directories in .Ev TRUSTPATH and all untrusted certificates in .Ev UNTRUSTPATH . A symbolic link to each trusted certificate is placed in .Ev CERTDESTDIR and each untrusted certificate in .Ev UNTRUSTDESTDIR . t Ic untrust Add the specified file to the untrusted list. t Ic trust Remove the specified file from the untrusted list. .El .Sh ENVIRONMENT l -tag -width UNTRUSTDESTDIR t Ev DESTDIR Alternate destination directory to operate on. t Ev DISTBASE Additional path component to include when operating on certificate directories. t Ev LOCALBASE Location for local programs. Defaults to the value of the user.localbase sysctl which is usually

a /usr/local . t Ev TRUSTPATH List of paths to search for trusted certificates. Default:

a <DESTDIR><DISTBASE>/usr/share/certs/trusted

a <DESTDIR><DISTBASE>/usr/local/share/certs

a <DESTDIR><DISTBASE><LOCALBASE>/etc/ssl/certs t Ev UNTRUSTPATH List of paths to search for untrusted certificates. Default:

a <DESTDIR><DISTBASE>/usr/share/certs/untrusted

a <DESTDIR><DISTBASE><LOCALBASE>/etc/ssl/untrusted

a <DESTDIR><DISTBASE><LOCALBASE>/etc/ssl/blacklisted t Ev CERTDESTDIR Destination directory for symbolic links to trusted certificates. Default:

a <DESTDIR><DISTBASE>/etc/ssl/certs t Ev UNTRUSTDESTDIR Destination directory for symbolic links to untrusted certificates. Default:

a <DESTDIR><DISTBASE>/etc/ssl/untrusted t Ev EXTENSIONS List of file extensions to read as certificate files. Default: *.pem *.crt *.cer *.crl *.0 .El .Sh SEE ALSO .Xr openssl 1 .Sh HISTORY .Nm first appeared in .Fx 12.2 .Sh AUTHORS .An Allan Jude Aq Mt allanjude@freebsd.org