我使用 Visual Studio 2017 中的内置 Web 发布和 Web Deploy 来部署到内部网站。 15.9.3 升级后,web 部署发布现在失败并出现错误:
---------------------------
Microsoft Visual Studio
---------------------------
Could not complete the request to remote agent URL 'https://[redacted]:8172/msdeploy.axd?site=[redacted]'.
The request was aborted: Could not create SSL/TLS secure channel.
---------------------------
OK
---------------------------
这确实适用于 Visual Studio 2015 中完全相同的 .sln
文件,因此服务器设置没有本质上的错误。目标服务器是 Windows Server 2008 R2。没有其他更新等。
那么,是什么给了?如何重新启用 Web 部署
最佳答案
根据@PanagiotisKanavos,问题是为 Windows Server 2008 R2 启用 TLS 1.1 和 TLS 1.2。作为 Visual Studio 2017 15.9.x 升级的一部分,内置 Web 部署似乎不再支持现已过时的 SSL 2.0。
最后我按照 KB3140245 的说明进行操作,其中包括更新和 setting registry values (也在下面,从那个答案复制)。
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp
On x64-based computers, DefaultSecureProtocols must also be added to the Wow6432Node path:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp
我还应用了这些注册表项:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001
我可能用力过猛,所以上面的条目可能不是必需的。
关于visual-studio - Visual Studio 2017 15.9 升级后 WebDeploy 失败并出现 SSL/TLS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53595952/