Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication Yesod脚手架现场布劳塞利德TlsException 我想做什么_Authentication_Ssl_Docker_Yesod - Fatal编程技术网

Authentication Yesod脚手架现场布劳塞利德TlsException 我想做什么

Authentication Yesod脚手架现场布劳塞利德TlsException 我想做什么,authentication,ssl,docker,yesod,Authentication,Ssl,Docker,Yesod,使用YesSOD中的BrowserId创建并验证用户 我试过的 我还没有修改脚手架上的认证码。我在Foundation.hs中读到的以下内容表明,当他们使用browserId进行身份验证时,这将创建一个新用户 getAuthId creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds case x of Just (Entity uid _) -> return $ Just uid

使用YesSOD中的
BrowserId
创建并验证用户

我试过的 我还没有修改脚手架上的认证码。我在
Foundation.hs
中读到的以下内容表明,当他们使用browserId进行身份验证时,这将创建一个新用户

getAuthId creds = runDB $ do
    x <- getBy $ UniqueUser $ credsIdent creds
    case x of
        Just (Entity uid _) -> return $ Just uid
        Nothing -> Just <$> insert User
            { userIdent = credsIdent creds
            , userPassword = Nothing
            }
我找不到生成此的文件。起初,我认为通过https服务站点可能会解决这个问题,但现在我已经实现了https,但事实并非如此。我用的是签名的CA证书

预期行为 对现有用户进行身份验证时,应将其登录。对以前未知的用户进行身份验证时,应添加这些用户

谁能解释一下我错过了什么

编辑:
tls retreivecertificate
输出 运行
tls retrievecertificate mydomain.com 443--verify--chain
表明我的站点正在成功返回其证书和签名机构的证书,但导致
未知NCA的失败

运行tls retrievecertificate twitter.com 443--验证--链
显示证书和一个
未知NCA

因此,我认为这里的问题在于运行YesSOD应用程序的机器或代理设置,而不是我如何在运行web服务器的机器上安装证书(两者实际上都是Docker容器,因此我广泛使用“机器”一词)。我正在寻找一个解决方案,如果我找到了,我会发布一个。在此期间,所有的帮助都得到了感激。我的Nginx设置如下所示:

# see http://serverfault.com/questions/577370/how-can-i-use-environment-variables-in-nginx-conf#comment730384_577370
upstream localhost {
    server api_1:3000;
}

server {
    listen 80;
    listen [::]:80;

    server_name example.com;

    return 301 https://$server_name$request_uri;
}
server {
    listen 443 default_server ssl;

    server_name example.com;

    ssl on;
    ssl_certificate /etc/nginx/ssl.cert;
    ssl_certificate_key /etc/nginx/ssl.dkey;
    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://localhost;
        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 https;
    }
}

原来这是一个码头工人的问题,而不是一个问题。运行应用程序的Docker容器没有受信任的证书,所以我只是重新构建它,然后从主机添加这些证书。问题已解决。

请按照TLS调试步骤进行操作:@MichaelSnoyman感谢您的提示-我已编辑了问题,以反映获得的信息。这很可能会成为一种“自责错过了它”的情况,但现在我仍然感到困惑。
# see http://serverfault.com/questions/577370/how-can-i-use-environment-variables-in-nginx-conf#comment730384_577370
upstream localhost {
    server api_1:3000;
}

server {
    listen 80;
    listen [::]:80;

    server_name example.com;

    return 301 https://$server_name$request_uri;
}
server {
    listen 443 default_server ssl;

    server_name example.com;

    ssl on;
    ssl_certificate /etc/nginx/ssl.cert;
    ssl_certificate_key /etc/nginx/ssl.dkey;
    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://localhost;
        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 https;
    }
}