1. The problem I’m having:
I have a Caddy reverse proxy to a Gitea instance. I can access the Gitea instance via browser just fine. When I attempt to perform a git push
, it fails with:
fatal: unable to access 'https://gitea.privateserver.com/user/test-first-repo.git/': OpenSSL/3.1.2: error:0A000438:SSL routines::tlsv1 alert internal error
2. Error messages and/or full log output:
Note that I enabled debug mode and tried running $ journalctl -u caddy --no-pager | less +G
. The resulting opened file is empty every time, even immediately after attempting a push
.
~
~
~
-- No entries --
(END)
A curl request:
PS C:\Users\user\Documents\test> curl -v https://gitea.privateserver.com/user/test-first-repo.git/
VERBOSE: GET with 0-byte payload
VERBOSE: received -1-byte response of content type text/html; charset=UTF-8
StatusCode : 200
StatusDescription : OK
3. Caddy version:
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
#!/bin/bash
# Update and upgrade system packages
sudo yum update
sudo yum upgrade
# Download and extract Go
wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
tar -xvf go1.21.5.linux-amd64.tar.gz
# Move Go to the system directory
sudo mv go /usr/local
# Set up Go environment variables
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc
# Install xcaddy
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
# Build Caddy with Route 53 DNS plugin
xcaddy build --with github.com/caddy-dns/route53
# Move Caddy to the system binaries directory
sudo mv caddy /usr/local/bin
# Create Caddyfile
mkdir /etc/caddy && touch /etc/caddy/Caddyfile
a. System environment:
[ec2-user@ip-10-0-0-1 caddy]$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-15"
b. Command:
caddy run
c. Service/unit/compose file:
not applicable
d. My complete Caddy config:
gitea.privateserver.com {
reverse_proxy 10.0.0.10:80
tls {
dns route53 {
max_retries 10
}
}
}
5. Additional information:
All of this is running in a private subnet that allows only whitelisted IP addresses to access it. I’m not sure I should publicize the domain name here, despite the template’s indication to do so. Even with it being shared, nobody would receive responses should they try to query it. Please let me know if it should still be shared for other reasons.
I am assuming that pushes would not work with SSH because Caddy doesn’t support SSH. However, I did expect HTTPS pushing to work.