Hello community,
I'm getting a
I issued certs on a site with acme.sh and the dns challenge was successful. I used the DNS API method:
Everything works fine on port 80, but after turning on https (which is a button at the Cloudflare panel), the site throws a
Regardless, I created a whitelist for Cloudflare's proxies, even though they were passing without it, and that made no difference. I also checked my webroot location and permissions and they appear to be fine. The webroot is set to /var/www/htdocs in .acme.sh/mysite.io/mysite.io.conf, and all of the static content in the site is readable by the world.
Any thoughts as to why I'm getting a 521 error? Below are my /etc/pf.conf and /usr/local/etc/obhttpd.conf files.
Thank you
/usr/local/etc/obhttpd.conf
/etc/pf.conf
I'm getting a
521 error
after setting up SSL on a domain that is hosted on Cloudflare. This is a FreeBSD-12.0-RELEASE-p10 machine running obhttpd and PF.I issued certs on a site with acme.sh and the dns challenge was successful. I used the DNS API method:
Code:
$ sh
$ sudo su
# export CF_Key"sdfsdfsdfljlbjkljlkjsdfoiwje"
# export CF_Email"xxxxxxxxxxxxx"
# acme.sh --issue --dns dns_cf -d mysite.io -d www.mysite.io -w /var/www/htdocs --force > dnschalleng.log
2>&1
521 error
. According the Cloudflare documentation, this is almost always a firewall issue, where Cloudflare's proxies are being blocked. That said, I added log
to every inbound rule in pf.conf, and fired up pflog0 to search for the proxies, which are listed on Cloudflare's site. It appears that the proxies are not being blocked or rate limited. In fact, they appear to be passing on port 443. Here is a glimpse of pflog0 showing one of the proxies passing:
Code:
sudo tcpdump -n -e -ttt -v -i pflog0 inbound
162.158.255.30.33426 > XXX.XX.XXX.XXX.443: Flags [S], cksum 0x6157 (correct), seq
1430716507, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 10], length 0
00:00:00.221510 rule 9/0(match): pass in on if0: (tos 0x0, ttl 59, id 24959, offset 0, flags [DF], proto TCP (6), length 52)
Any thoughts as to why I'm getting a 521 error? Below are my /etc/pf.conf and /usr/local/etc/obhttpd.conf files.
Thank you
/usr/local/etc/obhttpd.conf
Code:
public_ip = "XXX.XXX.XX.XX"
chroot "/var/www"
server "www.mysite.io" {
alias mysite.io
listen on $public_ip tls port 443
root "/htdocs"
}
/etc/pf.conf
Code:
ext_if = "if0"
tcp_services= "{ 22 53 123 }"
udp_services= "{ 53 123 }"
web_services= "{ 80 443 }"
icmp4_messages= "{ echoreq }"
table <blackhats> persist
table <crawlers> persist
table <rfc6890> { 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 \
169.254.0.0/16 172.16.0.0/12 192.0.0.0/24 \
192.0.0.0/29 192.0.2.0/24 192.88.99.0/24 \
192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 \
203.0.113.0/24 240.0.0.0/4 255.255.255.255/32 }
table <cloudflareIPv4> { 173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 \
103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 \
190.93.240.0/20 188.114.96.0/20 197.234.240.0/22 \
198.41.128.0/17 162.158.0.0/15 104.16.0.0/12 \
172.64.0.0/13 131.0.72.0/22 }
set skip on lo0
scrub in all
antispoof log quick for $ext_if
block in log quick on $ext_if from <rfc6890>
block return out log quick on egress to <rfc6890>
block log all
pass in log on $ext_if from <cloudflareIPv4>
pass in log proto tcp to port { 443 } \
keep state (max-src-conn 100, max-src-conn-rate 3/1, \
overload <crawlers> flush global) tag WEB
pass in log proto tcp to port { 22 } \
keep state (max-src-conn 15, max-src-conn-rate 3/1, \
overload <blackhats> flush global) tag SSH
pass out proto tcp to port $web_services
pass out proto tcp to port $tcp_services
pass out proto udp to port $udp_services
pass out inet proto icmp icmp-type $icmp4_messages