zoukankan      html  css  js  c++  java
  • wcf使用ssl连接方式设置

    A.makecert -sr localmachine -ss My -n CN=TopupProxyServer -sky exchange -pe -r B.检索证书的指纹 ,证书名TopupProxyServer C.设置 wsHttpBinding.binding的security mode为TransportWithMessageCredential;clientCredentialType为UserName

    <binding name="WSHttpBinding_ITerminalHandler" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="12000000" maxReceivedMessageSize="12000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="false" allowCookies="false">      <readerQuotas maxDepth="32" maxStringContentLength="12000000" maxArrayLength="12000000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />      <security mode="TransportWithMessageCredential">       <!--<transport clientCredentialType="None" />-->       <message clientCredentialType="UserName" />      </security>     </binding>

    D.设置<services>下的 service的binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITerminalHandler",注意如果是https的话, 那么<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>里面的binding应该是"mexHttpsBinding"

    <service behaviorConfiguration="ACS.AFC.DeferredTopup.Proxy.TerminalHandlerBehavior"     name="ACS.AFC.DeferredTopup.Proxy.TerminalHandler">         <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITerminalHandler"      contract="ACS.AFC.DeferredTopup.Proxy.ITerminalHandler">      <identity>       <dns value="localhost" />      </identity>     </endpoint>     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>      <host>       <baseAddresses>        <add baseAddress="https://localhost:444/"/>       </baseAddresses>      </host>         </service>

    E.设置behavior 注意<serviceMetadata httpsGetEnabled="true" />里面使用的是httpsGetEnabled

    <behavior name="ACS.AFC.DeferredTopup.Proxy.TerminalHandlerBehavior">      <serviceAuthorization principalPermissionMode="Custom">       <authorizationPolicies>        <add policyType="ACS.AFC.HostSecurityModule.AuthorizationPolicy, ACS.AFC.HostSecurityModule" />       </authorizationPolicies>      </serviceAuthorization>      <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200"       maxConcurrentInstances="200" />      <serviceMetadata httpsGetEnabled="true" />      <serviceDebug includeExceptionDetailInFaults="true" />      <serviceCredentials>       <clientCertificate>        <authentication certificateValidationMode="None" />       </clientCertificate>       <serviceCertificate findValue="TopupProxyServer" storeLocation="LocalMachine"        x509FindType="FindBySubjectName" />       <userNameAuthentication userNamePasswordValidationMode="Custom"        customUserNamePasswordValidatorType="ACS.AFC.HostSecurityModule.CustomUsernamePasswordValidator,ACS.AFC.HostSecurityModule" />      </serviceCredentials>     </behavior>

  • 相关阅读:
    mpvue 引入 vant-weapp 踩坑记录
    mac上hbuilder无法启动微信小程序调试窗口的解决办法
    mac 安装了xcode,flutter doctor 却检测不到展示叉叉
    vue 前端复制粘贴方式上传图片
    401 错误时,几个细节检查
    vue 图片src动态加载
    前端优化的大方向
    how to stop code runner in vscode(macOs)
    window server 2008 r2 TLS 升级1.2
    超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小
  • 原文地址:https://www.cnblogs.com/BinZeng/p/3410171.html
Copyright © 2011-2022 走看看