Azure Service Fabric - Owin 上的 Web Api - https 问题
Azure Service Fabric - Web Api on Owin - https problems
尝试在我的网站上启用 https Api 运行 在 Azure Service Fabric 中的自托管 Owin 上(从本地调试开始)。已按照 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>
Servicemanifest.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")
我已经验证网络 api 可以与 http 一起工作,但是当尝试部署到本地集群时,节点无法启动。当尝试调试正在发生的事情时,none 个断点被击中。
一直在读到其他人当时必须输入一个字符的指纹键,这似乎也不起作用。
对可能出错的地方有什么建议吗?
问题还是指纹错了!
我手动输入的不正确,所以我尝试从 MMC 控制台复制粘贴它。首先进入记事本,我在第一个字符上点击删除以删除任何 "invisible characters" 其他人遇到的问题。那没有用,Service Fabric 仍然崩溃。
然后我将从记事本复制的指纹粘贴到 Powershell 中,并注意到指纹前有一个看起来像正方形的字符。在 Powershell 中删除了那个方块并将指纹粘贴到我的配置文件中。
尝试构建,但没有! Visual Studio 抱怨我少了一个空格 (??)。然后我在 EndpointRef 和 CertificateRef 之间插入了一个换行符。再次发布到我的本地集群,现在它可以工作了。
尝试在我的网站上启用 https Api 运行 在 Azure Service Fabric 中的自托管 Owin 上(从本地调试开始)。已按照 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>
Servicemanifest.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")
我已经验证网络 api 可以与 http 一起工作,但是当尝试部署到本地集群时,节点无法启动。当尝试调试正在发生的事情时,none 个断点被击中。
一直在读到其他人当时必须输入一个字符的指纹键,这似乎也不起作用。
对可能出错的地方有什么建议吗?
问题还是指纹错了!
我手动输入的不正确,所以我尝试从 MMC 控制台复制粘贴它。首先进入记事本,我在第一个字符上点击删除以删除任何 "invisible characters" 其他人遇到的问题。那没有用,Service Fabric 仍然崩溃。
然后我将从记事本复制的指纹粘贴到 Powershell 中,并注意到指纹前有一个看起来像正方形的字符。在 Powershell 中删除了那个方块并将指纹粘贴到我的配置文件中。
尝试构建,但没有! Visual Studio 抱怨我少了一个空格 (??)。然后我在 EndpointRef 和 CertificateRef 之间插入了一个换行符。再次发布到我的本地集群,现在它可以工作了。