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 August 18, 2025 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 CERTDESTDIR 110and each untrusted certificate in 111.Ev UNTRUSTDESTDIR . 112In addition, a bundle containing the trusted certificates is placed in 113.Ev BUNDLEFILE . 114.It Ic untrust 115Add the specified file to the untrusted list. 116.It Ic trust 117Remove the specified file from the untrusted list. 118.El 119.Sh ENVIRONMENT 120.Bl -tag -width UNTRUSTDESTDIR 121.It Ev DESTDIR 122Absolute path to an alternate destination directory to operate on 123instead of the file system root, e.g. 124.Dq Li /tmp/install . 125.It Ev DISTBASE 126Additional path component to include when operating on certificate directories. 127This must start with a slash, e.g. 128.Dq Li /base . 129.It Ev LOCALBASE 130Location for local programs. 131Defaults to the value of the user.localbase sysctl which is usually 132.Pa /usr/local . 133.It Ev TRUSTPATH 134List of paths to search for trusted certificates. 135Default: 136.Pa ${DESTDIR}${DISTBASE}/usr/share/certs/trusted 137.Pa ${DESTDIR}${LOCALBASE}/share/certs/trusted 138.Pa ${DESTDIR}${LOCALBASE}/share/certs 139.It Ev UNTRUSTPATH 140List of paths to search for untrusted certificates. 141Default: 142.Pa ${DESTDIR}${DISTBASE}/usr/share/certs/untrusted 143.Pa ${DESTDIR}${LOCALBASE}/share/certs/untrusted 144.It Ev TRUSTDESTDIR 145Destination directory for symbolic links to trusted certificates. 146Default: 147.Pa ${DESTDIR}${DISTBASE}/etc/ssl/certs 148.It Ev UNTRUSTDESTDIR 149Destination directory for symbolic links to untrusted certificates. 150Default: 151.Pa ${DESTDIR}${DISTBASE}/etc/ssl/untrusted 152.It Ev BUNDLE 153File name of bundle to produce. 154.El 155.Sh SEE ALSO 156.Xr openssl 1 157.Sh HISTORY 158.Nm 159first appeared in 160.Fx 12.2 . 161.Sh AUTHORS 162.An -nosplit 163The original shell implementation was written by 164.An Allan Jude Aq Mt allanjude@FreeBSD.org . 165The current C implementation was written by 166.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . 167