如何解决通过SSL连接到服务
一天中的好时光。使用OpenSSL创建了自签名证书。它在Azure中使用。将WCF项目发送到Azure时,发生错误:具有与https输入终结点关联的指纹的证书不包含私钥。我真的不明白为什么会这样。 cscfg文件:
<Certificates>
<Certificate name="SampleCertificate"
thumbprint="<Thumbprint>"
thumbprintAlgorithm="sha1" />
</Certificates>
csdef文件:
<Certificates>
<Certificate name="SampleCertificate"
storeLocation="LocalMachine"
storeName="CA"
permissionLevel="limitedOrElevated" />
</Certificates>
...
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
<Binding name="HttpsIn" endpointName="HttpsIn" />
</Bindings>
...
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
<InputEndpoint name="HttpsIn" protocol="https" port="443"
certificate="SampleCertificate" />
</Endpoints>
web.config:
<serviceCredentials>
<clientCertificate>
<authentication
certificateValidationMode="PeerOrChainTrust"
revocationMode="NoCheck"/>
</clientCertificate>
<serviceCertificate
findValue="<Thumbprint>"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindByThumbprint"/>
</serviceCredentials>
...
<security mode="Message">
<message clientCredentialType="Certificate"/>
</security>
...
<host>
<baseAddresses>
<add baseAddress="https://<host>"/>
</baseAddresses>
</host>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。