gpt4 book ai didi

azure - 如何在 Azure Web 角色上禁用 RC4 密码

转载 作者:太空宇宙 更新时间:2023-11-03 12:41:23 29 4
gpt4 key购买 nike

我有一个托管在 Microsoft Azure Web 角色上的 Web 应用程序。如何禁用 RC4 密码?

最佳答案

我使用 Powershell 脚本遇到的问题是需要修改的键包含正斜杠,而 Powershell 将此视为路径分隔符,因此脚本失败。

解决方案是创建一个控制台应用程序并将其设置为在启动时运行:

class Program
{
static void Main(string[] args)
{
string[] subKeys = new string[]
{
"RC4 40/128",
"RC4 56/128",
"RC4 64/128",
"RC4 128/128",
};

RegistryKey parentKey = Registry.LocalMachine.OpenSubKey(
@"SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers", true);

foreach (string keyName in subKeys)
{
var newKey = parentKey.CreateSubKey(keyName);
newKey.SetValue("Enabled", 0);
newKey.Close();
}
parentKey.Close();
}
}

将输出文件(在我的例子中为DisableRc4.exe)复制到webrole的根目录并设置为始终复制

创建一个文件DisableRc4.cmd,其中包含

.\DisableRc4.exe
EXIT /B 0

按如下方式更新您的 Web 角色的 ServiceDefinition.csdef

<Startup>
<Task commandLine="DisableRc4.cmd" executionContext="elevated" taskType="simple" />
</Startup>

我使用 https://www.ssllabs.com/ssltest/index.html 验证了 RC4 支持已被删除

启动前修改 Before startup cmd

之后 After startup cmd

关于azure - 如何在 Azure Web 角色上禁用 RC4 密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29777559/

29 4 0
文章推荐: c# - 统一;随机物体运动
文章推荐: python 记录 : Custom Python LogRecord Throwing an error
文章推荐: Android ViewPager + Webview,ClassCastException!在 viewpager 中需要 webview
文章推荐: c# - 在 Asp.net c# 中使用 linq 对 list 进行升序和降序排序