【问题标题】:Azure Service Fabric - Web Api on Owin - https problemsAzure Service Fabric - Owin 上的 Web Api - https 问题
【发布时间】:2017-02-14 22:58:33
【问题描述】:

尝试在 Azure Service Fabric 中的自托管 Owin 上运行的我的 Web Api 上启用 https(从本地调试开始)。已按照this blog中的步骤进行操作

我的 applicationmanifest.xml 看起来像这样:

  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="TheNetPkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides />
    <Policies>
      <EndpointBindingPolicy EndpointRef="serviceendpoint" CertificateRef="mycertificate" />
    </Policies>
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="TheNet">
      <StatelessService ServiceTypeName="TheNetType" InstanceCount="[TheNet_InstanceCount]">
        <SingletonPartition />
      </StatelessService>
    </Service>
  </DefaultServices>
  <Certificates>
    <EndpointCertificate X509StoreName="MY" X509FindValue="‎‎‎‎[thumbprint]" Name="mycertificate" />
  </Certificates>
</ApplicationManifest>

服务清单.xml

<Endpoints>
  <Endpoint Name="serviceendpoint" Type="Input" Protocol="https" Port="8087" />

</Endpoints>

关于证书(使用 makecert 自签名)我已经验证它存在于证书(本地计算机)-> 个人-> 证书中

我用 powershell 导入了证书

 Import-PfxCertificate -Exportable -CertStoreLocation Cert:\LocalMachine\My -FilePath [pathtocertificate\cert.pfx] -Password (Read-Host -AsSecureString -Prompt "Enter Certificate Password")

我已经验证了 web api 可以与 http 一起使用,但是当尝试部署到本地集群时,节点不会启动。当尝试调试正在发生的事情时,没有一个断点被命中。

一直在读到其他人当时必须输入指纹键一个字符,这似乎也不起作用。

对可能出现的问题有什么建议吗?

【问题讨论】:

    标签: azure ssl web owin azure-service-fabric


    【解决方案1】:

    问题毕竟是指纹错误!

    我手动输入的错误,所以我尝试从 MMC 控制台复制粘贴它。首先进入记事本,我在第一个字符上点击删除以删除其他人遇到问题的任何“不可见字符”。这不起作用,Service Fabric 仍然崩溃。

    然后,我将从记事本复制的指纹粘贴到 Powershell 中,并注意到指纹前有一个看起来像正方形的字符。在 Powershell 中删除该方块并将指纹粘贴到我的配置文件中。

    尝试构建,但没有! Visual Studio 抱怨我缺少空格 (??)。然后我在 EndpointRef 和 CertificateRef 之间插入了一个换行符。再次发布到我的本地集群,现在它可以工作了。

    【讨论】:

      猜你喜欢
      • 2016-08-27
      • 1970-01-01
      • 2018-03-02
      • 2021-07-31
      • 2017-04-22
      • 2017-03-26
      • 2016-09-29
      • 2019-11-30
      • 2018-01-06
      相关资源
      最近更新 更多