Lets Encypt、Firefox、ピアの証明書発行者が認識されない

Lets Encypt、Firefox、ピアの証明書発行者が認識されない

最近、TLS ターミネーションをバックエンド サーバーからリバース プロキシに戻しましたが、この非常に特殊な問題が発生しました。

nextcloud サイトに接続すると、Firefox に次のように表示されますSEC_ERROR_UNKNOWN_ISSUER

エラーの詳細情報 (証明書情報は下部にあります):

https://nextcloud.domain.com/

Peer’s Certificate issuer is not recognized.


HTTP Strict Transport Security: false

HTTP Public Key Pinning: false

奇妙なのは、この問題が他のブラウザでは発生せず、Firefox だけで発生することです (Firefox 95、Ubuntu 20.04、Windows 10、Android 12、拡張機能なし)。最初にサイトを閲覧し、Firefox を閉じてから再度開き、nextcloud の任意の URL を閲覧するとエラーが発生します。残念ながら、2 回目の閲覧でエラーが発生するかどうかは正確にはわかりませんが、Firefox の再起動後、2 回目、3 回目、または 4 回目の閲覧のいずれでも発生します。リバース プロキシで nginx を再起動すると、エラーを解決できます。

明確に言うと、Firefox の再起動が原因のようです。タブを閉じて再度開いてもエラーは発生しません。Firefox のサイト データを消去して再起動してみましたが、エラーは引き続き発生します。

さらに奇妙なのは、同じリバース プロキシで Let's Encrypt 証明書 (異なるサブドメイン) を使用して他のサイトをいくつか持っているのですが、そこではエラーを再現できないことです。これは firefox+nextcloud+nginx に限定されているようです。ただし、バックエンドの nginx/server を再起動しても影響はありません。したがって、リバース プロキシで特定の構成が欠落していると考えられます。

私は困惑しています。変更されたのは、TLS が終了する場所と新しい Lets Encrypt 証明書だけです。私が何か明らかなことを見逃していて、これが大きな問題ではないことを願っています。

完全な nginx 構成 (他のサブドメインと MIME タイプを除く):

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}
http {
        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/sites-enabled/*;

        ##
        # Hardening
        ##
 
        add_header Allow "GET, POST, HEAD" always;
        add_header X-XSS-Protection "1; mode=block";
}


# configuration file /etc/nginx/snippets/ssl-params.conf:
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA HIGH !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 valid=300s;
resolver_timeout 5s;
# Disable preloading HSTS for now.  You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; preload";
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
add_header X-Download-Options "noopen" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "none" always;
add_header X-XSS-Protection "1; mode=block" always;

ssl_dhparam /etc/ssl/certs/dhparam.pem;

# configuration file /etc/nginx/sites-enabled/nextcloud.domain.com:
server {
        listen 443 ssl http2;
        ssl_certificate /etc/letsencrypt/live/nextcloud.domain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/nextcloud.domain.com/privkey.pem;
        include snippets/ssl-params.conf;
        server_name nextcloud.domain.com;
        location / {
                proxy_pass https://BACKENDIP;
                proxy_set_header X-Real-IP $remote_addr;
        }
}

# configuration file /etc/nginx/sites-enabled/reverseproxy.conf:
server {
        listen 80;
        server_name _;
        return 301 https://$host$request_uri;
}

Firefox 経由のサーバー証明書からのいくつかの情報:

Subject Name
Common Name nextcloud.domain.com

Issuer Name
Country US
Organization Let's Encrypt
Common Name R3

Validity
Not Before Fri, 10 Dec 2021 19:29:21 GMT
Not After Thu, 10 Mar 2022 19:29:20 GMT

中級証明書:

Subject Name
Country US
Organization Let's Encrypt
Common Name R3

Issuer Name
Country US
Organization Internet Security Research Group
Common Name ISRG Root X1

Validity
Not Before Fri, 04 Sep 2020 00:00:00 GMT
Not After Mon, 15 Sep 2025 16:00:00 GMT

ルート証明書:

Subject Name
Country US
Organization Internet Security Research Group
Common Name ISRG Root X1

Issuer Name
Organization Digital Signature Trust Co.
Common Name DST Root CA X3

Validity
Not Before Wed, 20 Jan 2021 19:14:03 GMT
Not After Mon, 30 Sep 2024 18:14:03 GMT

プロキシまたはサーバーに関連するエラーはありません。HTTP 要求はコード 200 として表示されます。

以下は、Lets Encrypt Certbot を通じて数分間隔で発行された、私の 2 つのサーバー上の 2 つの証明書の比較です。

これは、Firefox に問題がある証明書です: 不正な証明書

これは Firefox が受け入れる証明書です: 良い証明書

少し気になる問題は、Firefox が信頼していないサイトを閲覧すると、Chrome では同じ組織によって発行されていないルート証明書が取得されることです。

関連情報