1. Caddy version (caddy version
):
v2.4.5
2. How I run Caddy:
a. System environment:
Docker version 20.10.8, build 3967b7d
b. Command:
docker-compose up -d ssl
c. Service/unit/compose file:
ssl:
image: caddy
container_name: lf-ssl
ports:
- 80:80
- 443:443
depends_on:
- app
volumes:
- lf-caddy-data:/data
- lf-caddy-config:/config
# https://caddyserver.com/docs/command-line
command: caddy reverse-proxy --from localhost --to app
restart: unless-stopped
volumes:
lf-caddy-config:
lf-caddy-data:
d. My complete Caddyfile or JSON config:
I do not supply one at this time.
3. The problem I’m having:
I’m trying to access my locally running app from a phone using my internal IP address on the same home network, e.g., https://192.168.86.249/
4. Error messages and/or full log output:
curl -v https://192.168.86.249/
* Trying 192.168.86.249...
* TCP_NODELAY set
* Connected to 192.168.86.249 (192.168.86.249) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS alert, internal error (592):
* error:14004438:SSL routines:CONNECT_CR_SRVR_HELLO:tlsv1 alert internal error
* Closing connection 0
curl: (35) error:14004438:SSL routines:CONNECT_CR_SRVR_HELLO:tlsv1 alert internal error
dc logs ssl
lf-ssl | {"level":"warn","ts":1631658643.6995146,"logger":"admin","msg":"admin endpoint disabled"}
lf-ssl | {"level":"info","ts":1631658643.6997552,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"proxy","https_port":443}
lf-ssl | {"level":"info","ts":1631658643.6998103,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"proxy"}
lf-ssl | {"level":"info","ts":1631658643.6998482,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x40003a6ee0"}
lf-ssl | {"level":"info","ts":1631658643.7009673,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"}
lf-ssl | {"level":"info","ts":1631658643.700988,"logger":"tls","msg":"finished cleaning storage units"}
lf-ssl | {"level":"warn","ts":1631658643.810716,"logger":"pki.ca.local","msg":"installing root certificate (you might be prompted for password)","path":"storage:pki/authorities/local/root.crt"}
lf-ssl | 2021/09/14 22:30:43 Warning: "certutil" is not available, install "certutil" with "apt install libnss3-tools" or "yum install nss-tools" and try again
lf-ssl | 2021/09/14 22:30:43 define JAVA_HOME environment variable to use the Java trust
lf-ssl | 2021/09/14 22:30:43 certificate installed properly in linux trusts
lf-ssl | {"level":"info","ts":1631658643.8413696,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["localhost"]}
lf-ssl | {"level":"info","ts":1631658643.841631,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
lf-ssl | Caddy proxying https://localhost -> http://app
lf-ssl | {"level":"info","ts":1631658643.8418415,"logger":"tls.obtain","msg":"acquiring lock","identifier":"localhost"}
lf-ssl | {"level":"info","ts":1631658643.880806,"logger":"tls.obtain","msg":"lock acquired","identifier":"localhost"}
lf-ssl | {"level":"info","ts":1631658643.881728,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"localhost"}
lf-ssl | {"level":"info","ts":1631658643.8817406,"logger":"tls.obtain","msg":"releasing lock","identifier":"localhost"}
lf-ssl | {"level":"warn","ts":1631658643.8820071,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [localhost]: no OCSP server specified in certificate"}
I don’t currently supply a Caddyfile so I did not turn on debug mode because I’m thinking this is a common problem for others and it’s a simple solution that I’ve just missed looking over the docs, I’m sorry.
5. What I already tried:
I tried changing the command line from localhost
to 192.168.86.249
:
command: caddy reverse-proxy --from 192.168.86.249 --to app