“The function requested is not supported” exception when using SmtpClient in Azure role

你说的曾经没有我的故事 提交于 2019-12-05 06:41:09
Mike Asdf

So apparently the problem was a mismatched NTLM version between servers.

After logging into the Azure roles and disabling the setting "Require NTLMv2 security" for clients, then it worked:

(Thanks to this answer and this answer for inspiration.)

Currently seeing if we can get our SMTP server upgraded to be NTLMv2-compatible. Otherwise we'll have to set up some automated code to somehow disable that setting on each generated role instance.

Apparently this code worked last month. So I'm guessing a recent Azure OS upgrade changed the default settings.

FYI: The registry key for this setting is

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0] "NtlmMinClientSec"=dword:20000000

To automate setting the registry key add a startup task containing a reg add command like this:

reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 ^
 /v NtlmMinClientSec ^
 /t REG_DWORD ^
 /d 0x20000000 ^
 /f

where /f forces the current setting to be overwritten and ^ just allows to break the command into multiple lines for better readability. Also make sure to save the command in ASCII encoding to prevent issues during role startup.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!