ASP.NET Web Forms许可证验证问题

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPDF许可证验证在ASP.NET Web Forms应用程序中失败。 对许可服务器的HTTP请求因不支持的TLS版本而被拒绝。

ASP.NET Web Forms 应用程序在 httpRuntime 未配置 targetFramework 属性时默认使用 TLS 1.0。 IronPDF 许可服务器需要 TLS 1.2,.NET Framework 4.6.1 及更高版本支持,但只有当 httpRuntime targetFramework 设置为该版本或更高版本时才支持。 <compilation targetFramework> 元素本身是不够的。 httpRuntime targetFramework 是控制外部 HTTP 请求期间 TLS 协议选择的内容。

解决方案

Web.config 中添加或更新 httpRuntime 元素。

如果缺少 httpRuntime,在 <system.web> 中添加:

<system.web>
  <httpRuntime targetFramework="4.7.2" />
</system.web>
<system.web>
  <httpRuntime targetFramework="4.7.2" />
</system.web>
XML

如果 httpRuntime 已存在但缺少 targetFramework,请添加该属性:

<httpRuntime maxRequestLength="4096" executionTimeout="110" targetFramework="4.7.2" />
<httpRuntime maxRequestLength="4096" executionTimeout="110" targetFramework="4.7.2" />
XML

using targetFramework="4.7.2" 或更高的值。 启用 TLS 1.2 的最低值是 "4.6.1"

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 20,088,359 | 版本: 2026.7 刚刚发布
Still Scrolling Icon

还在滚动吗?

想快速获得证据? PM > Install-Package IronPdf
运行示例看着你的HTML代码变成PDF文件。