相关疑难解决方法(0)

如何使用OpenSSL创建自签名证书

我正在为嵌入式Linux设备添加HTTPS支持.我尝试使用以下步骤生成自签名证书:

openssl req -new > cert.csr
openssl rsa -in privkey.pem -out key.pem
openssl x509 -in cert.csr -out cert.pem -req -signkey key.pem -days 1001
cat key.pem>>cert.pem
Run Code Online (Sandbox Code Playgroud)

这有效,但我在使用Google Chrome时遇到了一些错误:

这可能不是您要找的网站!
该网站的安全证书不受信任!

我错过了什么吗?这是构建自签名证书的正确方法吗?

ssl openssl certificate ssl-certificate x509certificate

1169
推荐指数
18
解决办法
139万
查看次数

让Chrome接受自签名的localhost证书

我为localhost CN创建了一个自签名SSL证书.Firefox正如预期的那样在最初抱怨之后接受此证书.然而,Chrome和IE拒绝接受它,即使在将证书添加到Trusted Roots下的系统证书存储区之后也是如此.即使我在Chrome的HTTPS弹出窗口中单击"查看证书信息"时列出的证书已正确安装,但仍然坚持认证证书不可信.

我该怎么办才能让Chrome接受证书并停止抱怨?

ssl google-chrome certificate self-signed

1080
推荐指数
39
解决办法
107万
查看次数

要使Internet Explorer 8接受自签名证书,我需要做什么?

我们在Intranet上使用自签名证书.如何让Internet Explorer 8接受它们而不向用户显示错误消息,我需要做什么?我们为Internet Explorer 7做的事情显然不起作用.

编辑:如果我将证书放入受信任的根证书颁发机构,Internet Explorer 7将不会显示任何错误.即使有证书,Internet Explorer 8似乎也显示错误.

ssl-certificate internet-explorer-8

233
推荐指数
8
解决办法
48万
查看次数

如何在localhost上为Apache提供HTTPS?

我被要求在本地主机上的Apache上使用自签名证书设置HTTPS,但我该如何实际做到这一点?我根本不知道.

apache ssl https localhost

189
推荐指数
8
解决办法
25万
查看次数

为localhost创建受信任的自签名SSL证书(用于Express/Node)

尝试遵循有关创建自签名证书以与localhost一起使用的各种说明,大多数说明似乎适用于IIS,但我正在尝试使用Nodejs/Express.它们都没有正常工作,因为在安装证书时,它不受信任.这是我尝试过的失败:

有人可以提供可以做到这一点的工作流程吗? 我可以安装一个证书,但我无法让chrome(v32)或IE(v10)中的证书受到信任.

编辑:在评论中建议问题是没有受信任的cert-root.我通过IE安装了证书,但它仍然不受信任.

openssl localhost ssl-certificate node.js express

110
推荐指数
8
解决办法
12万
查看次数

在本地主机上访问 https

我正在尝试让 https 在我的 Vite 本地主机环境中工作。Chrome 显示无效证书错误。

我已经像这样设置了 vite.config.js 文件:

import { defineConfig  } from 'vite'
import vue from '@vitejs/plugin-vue'
import fs from 'fs';

export default defineConfig({
  resolve: { alias: { '@': '/src' } },
  plugins: [vue()],
  https: {
    key: fs.readFileSync('RootCA-key.pem'),
    cert: fs.readFileSync('RootCA.pem')
  }
})
Run Code Online (Sandbox Code Playgroud)

当我运行它时npm run dev -- --https,它按预期工作,我没有从 Vite 收到任何问题。但是,Chrome 显示无效证书。

我使用 openssl 创建证书文件,这给了我 .crt、.pem 和 .key 文件。它们都不是二进制的,因此我将 .key 文件重命名为 RootCA-key.pem。我尝试使用 RootCA.pem 文件作为证书,并将 RootCA.crt 文件重命名为 RootCA-cert.pem 并将其用作证书。

作为临时解决方法,我在 Chrome 中启用了不安全的本地主机 (chrome://flags/#allow-insecure-localhost),这至少消除了警告。

ssl https vite

104
推荐指数
4
解决办法
12万
查看次数

你如何在localhost上使用https/SSL?

我想知道如何在localhost上的Web应用程序上设置SSL.

我没有这样做的背景,会提供指导.我已经完成了我的Web应用程序的实现,我需要它在localhost上使用https或者我在服务器上托管它.

有任何想法吗?

问候.

asp.net iis ssl localhost

85
推荐指数
3
解决办法
12万
查看次数

Visual Studio 2017启用SSL

如何在Visual Studio 2017中为项目启用SSL?

在VS15中,我可以选择Project - > Properties - > Debug - > Enable SSL.VS2017中不提供此选项.它搬到了哪里?

编辑:

我甚至尝试过编辑.\vs\config\applicationhost.config无济于事:

        <listenerAdapters>
            <add name="http" />
            <add name="https" />
        </listenerAdapters>

        <sites>
            <site name="WebSite1" id="1" serverAutoStart="true">
                <application path="/">
                    <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation=":8080:localhost" />
                </bindings>
            </site>
            <site name="Filters" id="2">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="c:\Users\Ashley\documents\visual studio 2017\Projects\Filters\src\Filters" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:51107:localhost" />
                    <binding protocol="https" bindingInformation="*:43107:localhost" />
                </bindings>
            </site>
            <siteDefaults>
                <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
                <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
            </siteDefaults> …
Run Code Online (Sandbox Code Playgroud)

ssl https kestrel-http-server visual-studio-2017

45
推荐指数
6
解决办法
4万
查看次数

Chrome 使用与 Visual Studio 不同的 localhost SSL 证书

VS 2019 16.5.0 Preview 5 Windows 10 Chrome 版本 80.0.3987.163(官方版本)(64 位)

我用谷歌搜索了这个并无法找到答案。

我正在尝试在本地主机上运行一个带有 TLS 的简单 asp.net core MVC 应用程序。

我所做的是创建一个新项目,然后在项目设置中启用 SSL 并将获得的 URL 复制为应用程序 URL 在此输入图像描述 在此输入图像描述

应用程序正常启动但 TLS CA 不可信?我按照这里的示例:/sf/answers/3415306191/并添加了经过认证的位于Personal/Certificates文件夹中来Trusted Root Certification Authorities - Certificates管理计算机证书,现在显示 CA 是受信任的。

我重新加载应用程序,发现 Chrome 使用的 localhost SSL 证书与我的计算机上注册的证书不同,因此 CA 仍然不受信任。 在此输入图像描述 在此输入图像描述

c# ssl google-chrome visual-studio asp.net-core

8
推荐指数
2
解决办法
9929
查看次数

解决生产中的Nodejs https.request自签名证书错误

我正在与Nginx一起使用Nodejs / Express。我正在尝试通过Express路由进行https.request,这会导致自签名证书错误。我已使用以下方法解决了开发模式下的错误:

process.env.NODE_TLS_REJECT_UNAUTHORIZED =“ 0”

效果很好。我将在CentOS上部署我的应用程序。我的问题是如何避免在生产模式下出现相同的错误。Nginx也正在CentOS上使用。我尝试根据如何在CentOS 6的nginx上创建SSL证书在 CentOS上创建证书

但是,这不能解决目的,因为Node应用程序可以在任何CentOS VM上运行,并且我不想为每个虚拟机执行这些步骤。我可以从应用程序方面做些什么来避免生产中的此错误?

我在StackOverflow上已经遇到的一些类似问题是:

ssl nginx self-signed node.js express

5
推荐指数
0
解决办法
1741
查看次数

如何在python 3中发出https请求

我想使用https协议从服务器下载文件。我应该怎么做呢?这是我使用http的基本代码

response=requests.get('http://url',stream='True')

handle=open('dest_file.txt','wb')
for chunk in response.iter_content(chunk_size=512):
    if chunk:  # filter out keep-alive new chunks
        handle.write(chunk)

handle.close()  
Run Code Online (Sandbox Code Playgroud)

请求模块也可以用于https吗?

python python-requests

5
推荐指数
1
解决办法
4868
查看次数

Blazor - app.UseIdentityServer(); 使用 .pfx 密钥文件 - 解析数字时遇到意外字符

我创建了一个新的 Blazor WebAssembly 应用程序,其中包含个人用户帐户、应用程序内存储用户帐户和 .NET 5 中托管的 ASP.NET Core。将我的应用程序部署到 Azure 应用服务时,出现以下错误:

\n
\n

未将对象引用设置为对象的实例。at\nMicrosoft.Extensions.DependencyInjection.IdentityServerBuilderConfigurationExtensions

\n
\n

阅读这些链接我必须在生产中为 IdentityServer 提供我自己的证书:

\n

Blazor Web Assembly 应用程序 .Net Core 托管:发布运行时错误

\n

/sf/answers/3983280031/

\n

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-5.0#example-deploy-to-azure-app-service

\n

然后我创建了一个.pfx这样的文件,并且我已经验证它是否有效并且我的密码是正确的。

\n

/sf/answers/3415306191/

\n

然后,我将该.pfx文件放置在我的Server项目根文件夹中并标记Copy to Output DirectoryCopy Always.

\n

然后我更新appsettings.json为如下所示:

\n
  "IdentityServer": {\n    "Clients": {\n      "BlazorTest.Client": {\n        "Profile": "IdentityServerSPA"\n      }\n    },\n    "Key": {\n      "Type": "File",\n      "FilePath": "localhost.pfx",\n      "Password": "MySercurePassword123?"\n    }\n  },\n
Run Code Online (Sandbox Code Playgroud)\n

现在该项目既无法在本地运行,也无法在 Azure 上运行。它失败并 …

c# azure identityserver4 blazor blazor-webassembly

5
推荐指数
1
解决办法
1546
查看次数

在本地IIS上启用SSL

我在Windows 8.1(在Mac上为Bootcamp)上运行localhost,需要启用ssl。

我已经在127.0.0.1和localhost上拥有默认服务器证书。我在端口443上将一个localhost分配给了我的网站。

https仍然会返回安全错误,因此我需要使用http

我的网站运行在44300端口(例如localhost:44300)上,我试图将证书绑定到44300,但仍然无法正常工作。

如何使我的locahost与https一起使用?谢谢

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

编辑

该证书由本地主机颁发,位于受信任的根证书颁发机构内:

在此处输入图片说明

顺便说一句,我按照此线程为我的网站颁发了证书:在Visual Studio中启用SSL

ssl https localhost ssl-certificate

2
推荐指数
2
解决办法
9990
查看次数