c# - 如何在 Azure 中运行安全的 Service Fabric 有状态服务?

标签 c# azure replication azure-service-fabric

我已经能够使用以下 Settings.xml 文件使其在本地工作。

<Section Name="ReplicatorSecurityConfig">
  <Parameter Name="CredentialType" Value="X509" />
  <Parameter Name="FindType" Value="FindByThumbprint" />
  <Parameter Name="FindValue" Value="InsertLocalhostThumbprintHere" />
  <Parameter Name="StoreLocation" Value="LocalMachine" />
  <Parameter Name="StoreName" Value="My" />
  <Parameter Name="ProtectionLevel" Value="EncryptAndSign" />
  <Parameter Name="AllowedCommonNames" Value="localhost" />
</Section>

但是,这在使用证书安全设置的 Azure 中的真实集群中不起作用。这是我修改后的 Settings.xml,我认为它可以工作,但事实并非如此。

<Section Name="ReplicatorSecurityConfig">
  <Parameter Name="CredentialType" Value="X509" />
  <Parameter Name="FindType" Value="FindByThumbprint" />
  <Parameter Name="FindValue" Value="InsertClusterThumbprintHere" />
  <Parameter Name="StoreLocation" Value="LocalMachine" />
  <Parameter Name="StoreName" Value="My" />
  <Parameter Name="ProtectionLevel" Value="EncryptAndSign" />
  <Parameter Name="AllowedCommonNames" Value="testapp1.eastus.cloudapp.azure.com" />
</Section>

在 azure 中的真实集群上发生的情况是辅助节点陷入“构建中”状态,并且其角色显示为 IdleSecondary,而不是我习惯的正常 ActiveSecondary。

我应该对AllowedCommonNames 使用什么设置?这到底是在做什么?为什么它不使用 RemoteCommonNames?我以为AllowedCommonNames是deprecated支持 RemoteCommonNames。我已经尝试过了,即使在本地,如果我将AllowedCommonNames修改为RemoteCommonNames,它也会在本地中断我的服务。

感谢任何帮助。

最佳答案

看起来我解决了自己的问题,我修改后的配置对于云来说很好,唯一的区别是我需要登录到集群中虚拟机规模集下的每个虚拟机,并将证书的公钥添加到受信任的根因为这是一个自签名证书。完成此操作后,事情就开始起作用了。

关于c# - 如何在 Azure 中运行安全的 Service Fabric 有状态服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36958909/

相关文章:

postgresql - Azure Postgresql 数据库诊断设置中看不到事件中心命名空间

python - Python 上的 Azure Face API 中人脸验证的错误代码请求

带 SSL 的 MySQL 复制——它是如何工作的?

Mysql 复制数据库中选定的表?

replication - Kubernetes 缩小特定的 pod

c# - 控件属性也存储在 ViewState 中吗?

c# - 生成从 csv 到列表框的列表

c# - 那里有任何像样的 C# 分析器吗?

javascript - 正则表达式可以在 JavaScript 中工作,但不能在 C# 中工作

C# LINQ .Any 不适用于 DocumentDb CreateDocumentQuery