What is best way to "delete the current certificate cache" in Caddy

1. Caddy version (caddy version):

root@pi:/# caddy version
v2.4.0-beta.1 h1:Ed/tIaN3p6z8M3pEiXWJL/T8JmCqV62FrSJCHKquW/I=

2. How I run Caddy:

a. System environment:

Raspbian lite OS (debian)

root@elite-pi:/var/lib/caddy/.local/share/caddy/pki/authorities/local# cat /etc/*release*
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

b. Command:

systemctl start caddy

c. Service/unit/compose file:

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
User=caddy
Group=caddy
#plugin modified caddy build for auth-portal and associated plugins
#/usr/bin/caddy now linked to /opt/caddy/releases/[current build]
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
#ExecStart=/opt/caddy/bin/caddy_linux_arm7_custom run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
#ExecReload=/opt/caddy/bin/caddy_linux_arm7_custom reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

d. My complete Caddyfile or JSON config:

root@elite-pi:/# caddy fmt /etc/caddy/Caddyfile
{
        #       storage file_system {
        #               root /opt/caddy/storage
        #       }
        local_certs
        http_port 80
        https_port 443
}
https://host.example.com, https://10.1.1.20 {
        log {
                level INFO
                format console
                output file /var/log/caddy/caddy.log
        }
        route /auth* {
                auth_portal {
                        path /auth
                        backends {
                                local_backend {
                                        method local
                                        path /opt/caddy/assets/conf/local/auth/user_db.json
                                        realm local
                                }
                        }
                        jwt {
                                token_name access_token
                                token_secret AnExampleSecretString123
                                token_lifetime 43200
                        }
                        ui {
                                theme basic
                                generic_template "/opt/caddy/templates/em20-tmpl/generic.template"
                                login_template "/opt/caddy/templates/em20-tmpl/login.template"
                                portal_template "/opt/caddy/templates/em20-tmpl/portal.template"
                                register_template "/opt/caddy/templates/em20-tmpl/register.template"
                                whoami_template "/opt/caddy/templates/em20-tmpl/whoami.template"
                                settings_template "/opt/caddy/templates/em20-tmpl/settings.template"
                                custom_css_path "/opt/caddy/css/custom.css"
                                logo_url "/opt/caddy/templates/logo.png"
                                links {
                                        "Manager" /
                                        "Auth Portal Settings" /auth/settings
                                        "who am i check" /auth/whoami
                                        "Add MFA Authentication App" /auth/settings/mfa/add/app
                                }
                        }
                }
        }
        route /gr/* {
                jwt {
                        enable claim headers
                }
                reverse_proxy http://localhost:3000
        }
        route /version* {
                respond * "1.5.0-a" 200
        }
        route /ui/* {
                jwt {
                        enable claim headers
                }
                reverse_proxy http://localhost:1880
        }
        route /* {
                jwt {
                        primary yes
                        trusted_tokens {
                                static_secret {
                                        token_name access_token
                                        token_secret AnExampleSecretString123
                                }
                        }
                        enable claim headers
                }
                reverse_proxy http://localhost:1081
        }
}

3. The problem I’m having:

I am attempting to clean out all system trust (/etc/ssl/), clear the current local certificates and am wondering what is the correct approach to clearing the caddy server’s certificates located in the /var/lib/caddy/.local path.

Is the best approach to just remove the .local path and then restart caddy?

4. Error messages and/or full log output:

N/A

5. What I already tried:

6. Links to relevant resources:

This topic was automatically closed after 30 days. New replies are no longer allowed.