![](/img/trans.png)
[英]CSS Not being rendered, and error: “Firefox can't establish a connection to the server at localhost:4353.”
[英]Getting “Firefox can’t establish a connection to the server at localhost” despite having SSL enabled
我在ASP.NET Core中使用身份驗證的“ Individual User Account
方法創建具有Identity
的ASP.NET Web應用程序:
運行應用程序時,我在瀏覽器中收到錯誤消息:
無法連接:Firefox無法在localhost:44330建立與服務器的連接。 ...
在尋找解決方案的過程中,我發現禁用SSL可能會導致這種情況,但是默認情況下已啟用。
我還添加了:
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
到public void ConfigureServices(IServiceCollection services)
方法並添加:
var options = new RewriteOptions()
.AddRedirectToHttps();
app.UseRewriter(options);
到public void Configure(IApplicationBuilder app, IHostingEnvironment env)
方法
我根據尋找解決方案的信息嘗試了其他事情
URL Rewrite
一切都沒有運氣。
經過數小時的反復試驗和錯誤,我可以按照以下步驟在Chrome上運行我的網絡應用:
對於Chrome
chrome://net-internals/#hsts
復制並chrome://net-internals/#hsts
到瀏覽器(Chrome)中,然后點擊運行 Delete domain security policies
”。在“域”字段中輸入localhost
,然后單擊“刪除”。 該應用程序現在可以在Chrome上運行。 一旦找到適用於所有瀏覽器的解決方案,我將立即更新此帖子。
我還發現啟動瀏覽器的網址必須與“ Enable SSL
復選框中指定的網址匹配:
要到達此處, Right click on Project -> Properties -> Debug
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.