From nobody Mon Sep 12 14:22:51 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MR82c5Zdsz4cd02 for ; Mon, 12 Sep 2022 14:23:04 +0000 (UTC) (envelope-from gobble.wa@gmail.com) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MR82c2YYLz3xGF for ; Mon, 12 Sep 2022 14:23:04 +0000 (UTC) (envelope-from gobble.wa@gmail.com) Received: by mail-pj1-x1030.google.com with SMTP id q62-20020a17090a17c400b00202a3497516so5981865pja.1 for ; Mon, 12 Sep 2022 07:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=JlSvzfvC12NGVya4cFpB96i7oF2IwphGNDTS+DETpn8=; b=bf3cREOV0KDYvpWdoh2FZGa8hmVDEvp+tM8ImMFpi2SVMUO1aV3dXv1gnQYLAu8216 1R7CkgEaLH3plu+7hbaaVjYXJUatCmloGdmpoRbI/5lJ+ZrnuRy10++v5BHLOQ/NROZK bMgbzxLEiQgYombhJGMe1s6rVCblFbGFxhAcTitNXvilcCuusQBylvzJKZy5J0Z5mCm1 sGiD/hwo6amn1p0Ty/cMTbdirHr8TrcpAMGqmMr/DGP+YlHD/tYnBWUD3TfIdQJKzTH7 GK/8/iR0KKYC7k8sabQMkBtqgZFMFioH5vlkSIGiWYfrWkxGiFiex5wqx27v1d3pK8iK aldw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=JlSvzfvC12NGVya4cFpB96i7oF2IwphGNDTS+DETpn8=; b=46gKTTSCcGSH/u78frCPL1hg67MWyq8hR7wDAp1m7/eztuIsyMPnuUyBg2/5CBy9MZ SgkwKaSIK0sY/Lii/jJUy2alCQ03uSqXcXHYBEQCtnd1leodw73vUbB4Jip3qTLvCjLI 4zBb18HBiUcouymdXL0ypR3TsOaImbfAjoA03tVXL7yttZwK6wmmQUMJybSijvj8BO5k o4avKcmqVcljmHqLAD15QDIJIqcDK8DIrCkchSJSy5FUxUcT5RCbnnbCY7rApVbKmf0T /jxB6NIzxu+YCqc2Td51NBcopS3MyqdhCsDgp/g5UL7V6holn6cTQg7GlFh+Q6EA0fEk HGxg== X-Gm-Message-State: ACgBeo2TRTVTI/SDSEafUE0Z4unYB+bIACWMPdh0oxR0K+2d8c1zmdPR VJxq/Kx4o8kEYX63DKzQ/IpImLUrQVv0dFJffODfouMAaS/HpA== X-Google-Smtp-Source: AA6agR6oIj4U78Z3zJvAXPx7jG0ixaUWAQQuhRA6LGRQt0xkz3Ftxk/A00nEF0RCVeItET1sJGien+X060qLbZMyqMI= X-Received: by 2002:a17:902:a70f:b0:170:8d38:c57e with SMTP id w15-20020a170902a70f00b001708d38c57emr27376977plq.8.1662992583500; Mon, 12 Sep 2022 07:23:03 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <1832f40c8af.10b332ee2406187.6375306777861801560@eye-of-odin.com> <1832f85d371.10bae82d3411853.462587170353998748@eye-of-odin.com> <1832fe45fb5.df336718422020.6612482456577931531@eye-of-odin.com> In-Reply-To: From: Waitman Gobble Date: Mon, 12 Sep 2022 14:22:51 +0000 Message-ID: Subject: Re: any nginx/letsencrypt experts out there? To: freebsd-questions Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4MR82c2YYLz3xGF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=bf3cREOV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gobble.wa@gmail.com designates 2607:f8b0:4864:20::1030 as permitted sender) smtp.mailfrom=gobble.wa@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1030:from]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TAGGED_FROM(0.00)[]; TO_DN_ALL(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On Mon, Sep 12, 2022 at 2:01 PM paul beard wrote: > > > > On Sun, Sep 11, 2022 at 9:27 PM paul beard wrote: >> >> >> >> On Sun, Sep 11, 2022 at 9:11 PM Ty John wrote: >>> >>> >>> >>> >>> >>> >>> ---- On Mon, 12 Sep 2022 13:21:30 +0930 Waitman Gobble wrote --- >>> >>> > On Mon, Sep 12, 2022 at 2:42 AM Ty John ty-ml@eye-of-odin.com> wrote= : >>> > > >>> > > That order should be fine. The more specific locations should be l= isted first which is what you have. The redirect will trigger a new request= which will match the first stanza. >>> > > >>> > > Anyway, it looks fine to me as long as the certs themselves are ri= ght. >>> > > I just checked the certs on https://paulbeard.org, https://www.pau= lbeard.org and https://cloud.paulbeard.org and they all seem fine to me. >>> > > I suspect it might be a browser issue as you mentioned. What happe= ns in safari? >>> >> > > Hmm. So Safari is still having issues. It is able to load the root as www= .paulbeard.org but not without it. And the link to wordpress explicitly use= s www but it gets rewritten without and then fails for lack of a secure con= nection. I'll need to track down how that rewriting is happening. Who knew = Safari was so rigorous? > > This is the unadorned/non-www stanza: do I even need that in the year 202= 2? > > 71 server { > > 72 #listen 443 ssl http2; > > 73 listen [::]:443 ssl http2; > > 74 server_name paulbeard.org; > > 75 # if ($request ~* https://paulbeard.org) { > > 76 # return 301 https://www.paulbeard.org; > > 77 # } > > 78 ssl_certificate /usr/local/etc/letsencrypt/live/paulbeard.org= /fullchain.pem; # managed by Certbot > > 79 ssl_certificate_key /usr/local/etc/letsencrypt/live/paulbeard= .org/privkey.pem; # managed by Certbot > > 80 include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # = managed by Certbot > > 81 ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; # ma= naged by Certbot > > 82 > > 83 add_header X-Clacks-Overhead "GNU Terry Pratchett"; > > 84 # add Strict-Transport-Security to prevent man in the middle = attacks > > 85 add_header Strict-Transport-Security "max-age=3D15552000; inc= ludeSubDomains" always; > > 86 #rewrite ^(.*) https://www.paulbeard.org$1 permanent; #+ > > 87 #return 301 https://$host$request_uri; > > 88 > > 89 > > 90 root /usr/local/www/; > > 91 disable_symlinks off; > > 92 > > 93 } > > > Maybe your certs are kinda jumbled up? It seems requests to cloud.paulbeard.org returns cert for CN=3Dpaulbeard.org, while requests to paulbeard.org, www.paulbeard.org return cert for cloud.paulbeard.org =CE=BB #~> openssl s_client -showcerts -connect cloud.paulbeard.org:443 CONNECTED(00000004) depth=3D2 C =3D US, O =3D Internet Security Research Group, CN =3D ISRG Roo= t X1 verify return:1 depth=3D1 C =3D US, O =3D Let's Encrypt, CN =3D R3 verify return:1 depth=3D0 CN =3D paulbeard.org verify return:1 --- Certificate chain 0 s:CN =3D paulbeard.org i:C =3D US, O =3D Let's Encrypt, CN =3D R3 =CE=BB #~> openssl s_client -showcerts -connect paulbeard.org:443 CONNECTED(00000004) depth=3D2 C =3D US, O =3D Internet Security Research Group, CN =3D ISRG Roo= t X1 verify return:1 depth=3D1 C =3D US, O =3D Let's Encrypt, CN =3D R3 verify return:1 depth=3D0 CN =3D cloud.paulbeard.org verify return:1 --- Certificate chain 0 s:CN =3D cloud.paulbeard.org i:C =3D US, O =3D Let's Encrypt, CN =3D R3 =CE=BB #~> openssl s_client -showcerts -connect www.paulbeard.org:443 CONNECTED(00000004) depth=3D2 C =3D US, O =3D Internet Security Research Group, CN =3D ISRG Roo= t X1 verify return:1 depth=3D1 C =3D US, O =3D Let's Encrypt, CN =3D R3 verify return:1 depth=3D0 CN =3D cloud.paulbeard.org verify return:1 --- Certificate chain 0 s:CN =3D cloud.paulbeard.org i:C =3D US, O =3D Let's Encrypt, CN =3D R3 --