xref: /freebsd/usr.sbin/certctl/certctl.8 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright 2018 Allan Jude <allanjude@freebsd.org>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted providing that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd October 10, 2023
28.Dt CERTCTL 8
29.Os
30.Sh NAME
31.Nm certctl
32.Nd "tool for managing trusted and untrusted TLS certificates"
33.Sh SYNOPSIS
34.Nm
35.Op Fl v
36.Ic list
37.Nm
38.Op Fl v
39.Ic untrusted
40.Nm
41.Op Fl nUv
42.Op Fl D Ar destdir
43.Op Fl M Ar metalog
44.Ic rehash
45.Nm
46.Op Fl nv
47.Ic untrust Ar file
48.Nm
49.Op Fl nv
50.Ic trust Ar file
51.Sh DESCRIPTION
52The
53.Nm
54utility manages the list of TLS Certificate Authorities that are trusted by
55applications that use OpenSSL.
56.Pp
57Flags:
58.Bl -tag -width 4n
59.It Fl D Ar destdir
60Specify the DESTDIR (overriding values from the environment).
61.It Fl d Ar distbase
62Specify the DISTBASE (overriding values from the environment).
63.It Fl M Ar metalog
64Specify the path of the METALOG file (default: $DESTDIR/METALOG).
65.It Fl n
66No-Op mode, do not actually perform any actions.
67.It Fl v
68Be verbose, print details about actions before performing them.
69.It Fl U
70Unprivileged mode, do not change the ownership of created links.
71Do record the ownership in the METALOG file.
72.El
73.Pp
74Primary command functions:
75.Bl -tag -width untrusted
76.It Ic list
77List all currently trusted certificate authorities.
78.It Ic untrusted
79List all currently untrusted certificates.
80.It Ic rehash
81Rebuild the list of trusted certificate authorities by scanning all directories
82in
83.Ev TRUSTPATH
84and all untrusted certificates in
85.Ev UNTRUSTPATH .
86A symbolic link to each trusted certificate is placed in
87.Ev CERTDESTDIR
88and each untrusted certificate in
89.Ev UNTRUSTDESTDIR .
90.It Ic untrust
91Add the specified file to the untrusted list.
92.It Ic trust
93Remove the specified file from the untrusted list.
94.El
95.Sh ENVIRONMENT
96.Bl -tag -width UNTRUSTDESTDIR
97.It Ev DESTDIR
98Alternate destination directory to operate on.
99.It Ev DISTBASE
100Additional path component to include when operating on certificate directories.
101.It Ev LOCALBASE
102Location for local programs.
103Defaults to the value of the user.localbase sysctl which is usually
104.Pa /usr/local .
105.It Ev TRUSTPATH
106List of paths to search for trusted certificates.
107Default:
108.Pa <DESTDIR><DISTBASE>/usr/share/certs/trusted
109.Pa <DESTDIR><DISTBASE>/usr/local/share/certs
110.Pa <DESTDIR><DISTBASE><LOCALBASE>/etc/ssl/certs
111.It Ev UNTRUSTPATH
112List of paths to search for untrusted certificates.
113Default:
114.Pa <DESTDIR><DISTBASE>/usr/share/certs/untrusted
115.Pa <DESTDIR><DISTBASE><LOCALBASE>/etc/ssl/untrusted
116.Pa <DESTDIR><DISTBASE><LOCALBASE>/etc/ssl/blacklisted
117.It Ev CERTDESTDIR
118Destination directory for symbolic links to trusted certificates.
119Default:
120.Pa <DESTDIR><DISTBASE>/etc/ssl/certs
121.It Ev UNTRUSTDESTDIR
122Destination directory for symbolic links to untrusted certificates.
123Default:
124.Pa <DESTDIR><DISTBASE>/etc/ssl/untrusted
125.It Ev EXTENSIONS
126List of file extensions to read as certificate files.
127Default: *.pem *.crt *.cer *.crl *.0
128.El
129.Sh SEE ALSO
130.Xr openssl 1
131.Sh HISTORY
132.Nm
133first appeared in
134.Fx 12.2
135.Sh AUTHORS
136.An Allan Jude Aq Mt allanjude@freebsd.org
137