WCF配置备忘录

元素 说明

<system.serviceModel>
  <behaviors>
    <endpointBehaviors>
      <behavior> of <endpointBehaviors>
        <clientCredentials>
          <serviceCertificate> of <clientCredentials>

类型为:

X509RecipientCertificateServiceElement

.
1. 用来在客户端验证服务端的目的。
2. 在客户端设定服务器端的证书(客户端保存有服务器端的证书的公钥),设置了可以在SecurityMode =message的情况下减少一次证书交换,从而减少一次round trip.

下级元素

<defaultCertificate> Element

Specifies an X.509 certificate to be used when a service or STS does not provide one via a negotiation protocol. 默认的服务器端证书。在协商证书阶段,若服务器端没有提供的话,可以使用此证书来进行。设置此证书可以减少roundTrip,从而提高效率和安全性。在wcf中,若设置此项,则减少了服务器提供证书的环节。

<scopedCertificates> Element

Represents a collection of X.509 certificates provided by specific services (scoped) for authentication. This collection is typically used to specify the service certificates for Security Token Services in a federated scenario. 主要用在SSO票据的验证上面,若不能再匹配中找到,则使用defaultCertificate

<authentication> of <serviceCertificate> Element

Specifies authentication behaviors for service certificates used by a client.对服务器端证书的验证。

 

 

<issuedToken> 主要用于Secure Token Service (STS)

Specifies a custom token type used to authenticate the client to a Secure Token Service (STS). This element is of type IssuedTokenClientElement.

<peer> of <clientCredentials> Element 主要用于peer to peer模式的通信方式。一般不用设置。

Specifies a current peer credential. This element is of type PeerCredentialElement.

 

<system.serviceModel>/<behaviors>/<serviceBehaviors>/<behavior>/<serviceCredentials>/<clientCertificate>

 

作用有2:

  1. 验证客户端证书。(主要应用)

  2. 在双向通信模式下(duplex contract),主动向客户端发起请求时使用。

原文地址:https://www.cnblogs.com/headchen/p/1686195.html