6

几周前,我们对我们的 cookie 实施了 SameSite cookie 政策。如果我想在本地开发,我需要一个证书来获取 cookie。

我们正在运行一个 Node express 服务器,它被反向代理到我们添加证书的 nginx 配置。

# Server configuration
#
server {
    listen 443;
    server_name test-local.ad.ourdomain.com;
    ssl_certificate           /home/myname/.certs/ourcert.crt;
    ssl_certificate_key       /home/myname/.certs/ourkey.rsa;
    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
    location / {
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_pass          http://localhost:9090;
        proxy_read_timeout  90;
        proxy_redirect      http://localhost:9090 https://test-local.ad.ourdomain.com;
    }
}

现在到奇怪的部分。我们今天更新到 Chrome 80,突然之间我遇到了一个 HSTS 问题。即使我愿意,我也无法访问网站(没有选择加入的可能性)。我试图在 chrome://internals/#hsts 中清除它,这很有效。但是,我仍然得到NET::ERR_CERT_AUTHORITY_INVALID,但我现在可以选择替代方案。

从 Chrome 隐身模式访问它就像一个魅力,没有问题。与 Firefox 相同,也没有问题。它说证书有效,绿色且漂亮。也在这里检查:https ://www.sslshopper.com/certificate-decoder.html及其 100% 绿色。

我正在使用 Regolith 运行 Ubuntu 19.10。

我的同事使用的是相同的证书,也是 Chrome 80,但他们运行的是 Mac,Chrome 没有问题。

任何想法?我试图清除浏览器设置,没有改变。

4

2 回答 2

9

I have some great news!

We're using the same cert on our cloud dev environments (however, they are in pfx form). Locally I run Linux as mentioned, and I had to convert the pfx to a RSA file and a CRT file.

I entered our dev domain on this site: https://whatsmychaincert.com/ and it downloaded a *.chain.crt file. Together with my old crt file, and this command:

cat example.com.crt example.com.chain.crt > example.com.chained.crt

In Nginx I then referenced the .chained.crt file.

Now Chrome accepts my local, secure webpage.

于 2020-02-06T09:20:29.193 回答
-4

我们遇到了同样的问题,并按照petur 的解决方案进行了修复。

于 2020-02-12T15:45:35.080 回答