gpt4 book ai didi

django - 如何为 Azure 中的 django 项目获取 SSL 证书?

转载 作者:太空宇宙 更新时间:2023-11-03 14:06:49 24 4
gpt4 key购买 nike

我在 Azure 中有一个名为

的 django 项目
> djangoproj.azurewebsites.net

我想为此应用程序提供 SSL 层,当我尝试在 Azure 控制台中使用 openssl 时,出现以下错误

> openssl req -sha256 -new -nodes -keyout djangoproj.key -out proj.csr -newkey rsa:2048
D:\home\site\wwwroot
Generating a 2048 bit RSA private key
..................+++
.......................................+++
unable to write 'random state'
writing new private key to 'djangoproj.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:problems making Certificate Request

生成证书请求时出现问题。

我可以知道如何在 azure 中为我的应用程序获取正确的 SSL 证书吗?

最佳答案

这不是 TLS 在 Azure 应用服务中的工作方式。 TLS 在前端层终止。您的应用程序只需处理纯 HTTP。

TLS-and-ARR

如果您需要检查请求是否通过 HTTPS 发出:

应用程序请求路由 (ARR) 为通过 HTTPS 到达的每个请求附加一个特殊的请求 header 。 X-ARR-SSL 中包含的值提供有关用于保护客户端和 ARR 之间 TCP 连接的 TLS 服务器证书的信息。

例如:

X-ARR-SSL: 2048|256|C=US, S=Washington, L=Redmond, O=Microsoft Corporation,
OU=Microsoft IT, CN=Microsoft IT SSL SHA2|CN=*.azurewebsites.net

我在这里的另一个回答有更多关于该主题的内容:
Is current request being made over SSL with Azure deployment

May I know how to get a proper SSL certificate for my app in azure ?

https://azure.microsoft.com/en-us/documentation/articles/web-sites-purchase-ssl-web-site/

您可以在 https://{site}.azurewebsites.net 上获得免费的 TLS,也就是说,如果您真的不需要自定义域或只是想建立一个快速的概念证明。

关于django - 如何为 Azure 中的 django 项目获取 SSL 证书?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39703736/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com