小编Col*_*tie的帖子

由于 ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY,ASP.NET Core 3.0 应用程序无法在 Windows Server 2012 R2 上运行

我使用了一个可用的 ASP.NET Core 2.2 应用程序,将其升级到 3.0,突然该应用程序不再在 Windows Server 2012 中运行。它出现了以下内容:

ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY

铬合金: 在此处输入图片说明

火狐: 在此处输入图片说明

似乎在我不得不选择加入 HTTP/2 之前,现在它与 HTTP1.1 一起成为默认设置。这里有一个帖子,https://github.com/aspnet/AspNetCore/issues/14350但这完全令人困惑,没有真正的解决方案。

我尝试了各种启用/禁用不安全协议但无济于事。比如https://www.admin-enclave.com/de/articles-by-year/11-data-articles/website_articles/articles/exchange_articles/405-resolved-error-err_spdy_inadequate_transport_security-when-using-google-chome-和-owa.html

由于我认为更好的协议套件,在 Windows 10 上运行良好。但是在 Fiddler 中,我检查了与 Kestrel 谈判时的唯一区别是:

Windows Server 2012 R2:

[0A0A]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/
[1301]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/
[1302]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/
[1303]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/
[C02B]  TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
[C02F]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/
[C02C]  TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
[C030]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/
[CCA9]  Unrecognized cipher - See http://www.iana.org/assignments/tls-parameters/ …
Run Code Online (Sandbox Code Playgroud)

c# https network-protocols windows-server-2012-r2 asp.net-core

13
推荐指数
1
解决办法
6950
查看次数

如何在 ASP.NET Core 中缓存静态文件?

我似乎无法在 ASP.NET Core 2.2 中启用静态文件缓存。我有以下内容Configure

public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
  if (env.IsDevelopment()) {
    app.UseDeveloperExceptionPage();
    app.UseCors(...);
  }
  else {
    app.UseHsts();
  }

  app.UseHttpsRedirection();
  app.UseAuthentication();
  app.UseSignalR(routes => { routes.MapHub<NotifyHub>("/..."); });

  app.UseResponseCompression();
  app.UseStaticFiles();
  app.UseSpaStaticFiles(new StaticFileOptions() {
    OnPrepareResponse = (ctx) => {
      ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public, max-age=31557600"; // cache for 1 year
    }
  });
  app.UseMvc();

  app.UseSpa(spa => {
    spa.Options.SourcePath = "ClientApp";
    if (env.IsDevelopment()) {
      spa.UseVueCli(npmScript: "serve", port: 8080);
    }
  });
}
Run Code Online (Sandbox Code Playgroud)

当我尝试使用 chrome 在 HTTPS 上审核生产站点时,我不断收到“使用高效缓存策略提供静态资产”的消息:

审核截图

在网络选项卡中没有提到标题中的缓存,当我按 F5 时,似乎所有内容都来自磁盘缓存。但是,如果审计显示它不是,我怎么能确定我的缓存设置有效?

网络标签截图

caching static-files vue.js asp.net-core

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

dnSpy 显示异步方法的奇怪反汇编代码

我正在尝试使用最新版本的 dnSpy 反汇编我的 .NET core 3.1 二进制文件,但得到的输出如下:

在此输入图像描述

原来的方法:

public async Task<List<FirmwarePackage>> CalculatePackagesDeltaAsync(List<FirmwarePackage> firmwarePackages) {
  var packagesToUpdate = await GetPackageDifferences(firmwarePackages);

  // sort packages
  // "version-update" packages should be updated last, with "mez" being last
  packagesToUpdate = packagesToUpdate
    .OrderBy(x => x.TargetType)
    .ThenBy(x => x.Name)
    .ToList();

  packagesToUpdate.RemoveAll(x => x.Name == "version-update");

  var versionPkgs = firmwarePackages
    .Where(x => x.Name == "version-update")
    .OrderBy(x => x.TargetType);

  packagesToUpdate.AddRange(versionPkgs);
  return packagesToUpdate;
}
Run Code Online (Sandbox Code Playgroud)

这是正常的吗?我怎样才能把它变成更容易理解的东西。尝试调试这是一场噩梦。

在 github 存储库上,该issues资源不可用,这就是我在这里询问的原因。

c# disassembly async-await .net-core dnspy

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

如何使vue应用程序进行tree-shake以获取更小的文件?

我已经使用 Vue CLI 3 创建了一个应用程序,我一直在观察构建过程,它警告我有大文件:

$ vue-cli-service build --modern --mode production --dest dist --target app --dashboard


-  Building legacy bundle for production...

 WARNING  Compiled with 2 warnings12:40:54 PM


 warning  

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  js/chunk-vendors-legacy.443e5f8f.js (1.44 MiB)

 warning  

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.46 MiB)
      js/chunk-vendors-legacy.443e5f8f.js
      js/app-legacy.4b3e4352.js
Run Code Online (Sandbox Code Playgroud)

我不知道如何减少这个文件的大小,它完全来自外部库:

库大小

我以为它无法摆脱。就在今天,我在 …

javascript code-coverage webpack vue.js tree-shaking

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

为什么即使我设置了时区,docker build 仍不断询问我时区?

为什么使用下面的 dockerfile 创建新的 docker 映像一直要求我选择时区?我尝试了该ENV TZ命令的多种变体,但均无济于事。

 => => # Please select the geographic area in which you live. Subsequent configuration
 => => # questions will narrow this down by presenting a list of cities, representing
 => => # the time zones in which they are located.
 => => #   1. Africa   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. US
 => => #   2. America  4. Australia   6. Asia    8. Europe    10. Pacific  12. Etc
 => => …
Run Code Online (Sandbox Code Playgroud)

timezone docker dockerfile

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