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 April 24, 2026 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 lv 36.Ic list 37.Nm 38.Op Fl lv 39.Ic untrusted 40.Nm 41.Op Fl BnUv 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 48.Nm 49.Op Fl nv 50.Ic trust Ar 51.Sh DESCRIPTION 52The 53.Nm 54utility manages the list of TLS Certificate Authorities that are trusted by 55applications that use OpenSSL. 56.Pp 57The following options are available: 58.Bl -tag -width 4n 59.It Fl B 60Do not generate a bundle. 61This option is only valid in conjunction with the 62.Ic rehash 63command. 64.It Fl D Ar destdir 65Specify the DESTDIR (overriding values from the environment). 66.It Fl d Ar distbase 67Specify the DISTBASE (overriding values from the environment). 68.It Fl l 69When listing installed (trusted or untrusted) certificates, show the 70full path and distinguished name for each certificate. 71.It Fl M Ar metalog 72Specify the path of the METALOG file 73.Po 74default: 75.Pa ${DESTDIR}/METALOG 76.Pc . 77This option is only valid in conjunction with the 78.Ic rehash 79command. 80.It Fl n 81Dry-run mode. 82Do not actually perform any actions except write the metalog. 83.It Fl v 84Verbose mode. 85Print detailed information about each action taken. 86.It Fl U 87Unprivileged mode. 88Do not attempt to set the ownership of created files. 89This option is only valid in conjunction with the 90.Fl M 91option and the 92.Ic rehash 93command. 94.El 95.Pp 96Primary command functions: 97.Bl -tag -width untrusted 98.It Ic list 99List all currently trusted certificates. 100.It Ic untrusted 101List all currently untrusted certificates. 102.It Ic rehash 103Rebuild the list of trusted certificates by scanning all directories 104in 105.Ev TRUSTPATH 106and all untrusted certificates in 107.Ev UNTRUSTPATH . 108A copy of each trusted certificate is placed in 109.Ev TRUSTDESTDIR 110and each untrusted certificate in 111.Ev UNTRUSTDESTDIR . 112In addition, a bundle containing the trusted certificates is placed in 113.Ev BUNDLE . 114.It Ic untrust 115Add the specified file to the untrusted list. 116Note that the next 117.Ic rehash 118will remove it unless a copy of it is also placed somewhere in a 119directory included in 120.Ev UNTRUSTPATH . 121.It Ic trust 122Add the specified file to the trusted list, unless it is already 123untrusted. 124Note that the next 125.Ic rehash 126will remove it unless a copy of it is also placed somewhere in a 127directory included in 128.Ev TRUSTPATH . 129.El 130.Sh ENVIRONMENT 131.Bl -tag -width UNTRUSTDESTDIR 132.It Ev DESTDIR 133Absolute path to an alternate destination directory to operate on 134instead of the file system root, e.g. 135.Dq Li /tmp/install . 136.It Ev DISTBASE 137Additional path component to include when operating on certificate directories. 138This must start with a slash, e.g. 139.Dq Li /base . 140.It Ev LOCALBASE 141Location for local programs. 142Defaults to the value of the user.localbase sysctl which is usually 143.Pa /usr/local . 144.It Ev TRUSTPATH 145List of paths to search for trusted certificates. 146Default: 147.Pa ${DESTDIR}${DISTBASE}/usr/share/certs/trusted 148.Pa ${DESTDIR}${LOCALBASE}/share/certs/trusted 149.Pa ${DESTDIR}${LOCALBASE}/share/certs 150.It Ev UNTRUSTPATH 151List of paths to search for untrusted certificates. 152Default: 153.Pa ${DESTDIR}${DISTBASE}/usr/share/certs/untrusted 154.Pa ${DESTDIR}${LOCALBASE}/share/certs/untrusted 155.It Ev TRUSTDESTDIR 156Destination directory for symbolic links to trusted certificates. 157Default: 158.Pa ${DESTDIR}${DISTBASE}/etc/ssl/certs 159.It Ev UNTRUSTDESTDIR 160Destination directory for symbolic links to untrusted certificates. 161Default: 162.Pa ${DESTDIR}${DISTBASE}/etc/ssl/untrusted 163.It Ev BUNDLE 164File name of bundle to produce. 165Default: 166.Pa ${DESTDIR}${DISTBASE}/etc/ssl/cert.pem 167.El 168.Sh SEE ALSO 169.Xr openssl 1 170.Sh HISTORY 171.Nm 172first appeared in 173.Fx 12.2 . 174.Sh AUTHORS 175.An -nosplit 176The original shell implementation was written by 177.An Allan Jude Aq Mt allanjude@FreeBSD.org . 178The current C implementation was written by 179.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . 180