<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ERR_CERT_AUTHORITY_INVALID &#8211; Bubblog</title>
	<atom:link href="https://blog.yangyuanping.com/tag/err_cert_authority_invalid/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.yangyuanping.com</link>
	<description>nullable reference types</description>
	<lastBuildDate>Fri, 19 Dec 2025 17:20:00 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://blog.yangyuanping.com/wp-content/uploads/2025/11/cropped-patrick_log_logo_251121-2-32x32.png</url>
	<title>ERR_CERT_AUTHORITY_INVALID &#8211; Bubblog</title>
	<link>https://blog.yangyuanping.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>本地开发环境的自签名 HTTPS 证书不被信任(net::ERR_CERT_AUTHORITY_INVALID)</title>
		<link>https://blog.yangyuanping.com/%e6%9c%ac%e5%9c%b0%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e7%9a%84%e8%87%aa%e7%ad%be%e5%90%8d-https-%e8%af%81%e4%b9%a6%e4%b8%8d%e8%a2%ab%e4%bf%a1%e4%bb%bbneterr_cert_authority_invalid/</link>
		
		<dc:creator><![CDATA[peny911]]></dc:creator>
		<pubDate>Fri, 19 Dec 2025 05:02:49 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[ERR_CERT_AUTHORITY_INVALID]]></category>
		<category><![CDATA[https]]></category>
		<guid isPermaLink="false">https://blog.yangyuanping.com/?p=1053</guid>

					<description><![CDATA[问题描述 本地运行后端项目后，通过浏览器调用 API 时提示： POST https://&#60;ip&#62; [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>问题描述</h2>
<p>本地运行后端项目后，通过浏览器调用 API 时提示：</p>
<pre><code> POST https://&lt;ip&gt;:&lt;port&gt;/path net::ERR_CERT_AUTHORITY_INVALID</code></pre>
<p><strong>原因</strong>：本地开发环境使用的是 .NET 自签名 HTTPS 证书，浏览器默认不信任该证书。</p>
<h2>解决方案</h2>
<h3>方案 1：信任 .NET 开发证书（推荐）</h3>
<pre><code class="language-bash"> dotnet dev-certs https --trust</code></pre>
<p>如果提示证书已存在但不信任，先清理再重新生成：</p>
<pre><code class="language-bash"> dotnet dev-certs https --clean
 dotnet dev-certs https --trust</code></pre>
<blockquote>
<p>一次性解决，之后所有 .NET 本地开发项目都会自动信任。</p>
</blockquote>
<h3>方案 2：使用 HTTP 端口</h3>
<p>修改前端 SDK 的开发环境端点，使用 HTTP 端口 &lt;code&gt;5085&lt;/code&gt; 而非 HTTPS 端口 &lt;code&gt;7218&lt;/code&gt;：</p>
<pre><code class="language-javascript"> // webpack.config.js 或 sdk.js 中
 resolveEndpoint: 'http://&lt;ip&gt;:&lt;port&gt;/path'</code></pre>
<h3>方案 3：浏览器手动信任</h3>
<ol>
<li>直接访问 &lt;code&gt;https://&lt;ip&gt;:&lt;port&gt;/swagger&lt;/code&gt;</li>
<li>浏览器会提示&quot;不安全&quot;，点击&quot;高级&quot; → &quot;继续访问&quot;</li>
<li>
<p>之后该证书在当前浏览器会话中被临时信任</p>
<h3>方案 4：Chrome 启动参数（临时）</h3>
<pre><code class="language-bash"># macOS
open -a "Google Chrome" --args --ignore-certificate-errors --ignore-urlfetcher-cert-requests

# Windows
chrome.exe --ignore-certificate-errors --ignore-urlfetcher-cert-requests</code></pre>
<blockquote>
<p>注意：此方式会忽略所有证书错误，仅用于开发调试。</p>
</blockquote>
</li>
</ol>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
