簡體   English   中英

這可能是由於在 HTTPS 案例中未使用 HTTP.SYS 正確配置服務器證書。 c#

[英]This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. c#

也許這個問題已經有了,但我認為情況不同。 我從 web 配置文件配置所有必需的東西並安裝證書。

I consume java web service in ASP.NET WEB API. SOAP 服務已配置相互身份驗證。 (雙向 SSL)我有 2 個 Keystore 文件。 (client.jks 和 truststore.jks)

我的完整錯誤:這可能是由於在 HTTPS 案例中未使用 HTTP.SYS 正確配置服務器證書。 這也可能是由於客戶端和服務器之間的安全綁定不匹配造成的。

網絡配置:

<customBinding>
        <binding name="MyBinding">
          <textMessageEncoding messageVersion="Soap11"/>
          <security authenticationMode="MutualCertificate" enableUnsecuredResponse="true" allowSerializedSigningTokenOnReply="true"
                    messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
                    includeTimestamp="false">
          </security>
          <httpsTransport />
        </binding>
</customBinding>


<endpoint behaviorConfiguration="ClientCredentialsBehavior" address="https://abc.bank.dm:9193/Money/Money" binding="customBinding" bindingConfiguration="MyBinding" contract="Ref.Port" name="Port">
        <identity>
          <dns value="test"/>
        </identity>
</endpoint>


<behaviors>
      <endpointBehaviors>
        <behavior name="ClientCredentialsBehavior">
          <clientCredentials>
            <clientCertificate findValue="2d73n94087857dndyr874ydr"
                 storeLocation="CurrentUser"
                 storeName="My"
                 x509FindType="FindByThumbprint" />
            <serviceCertificate>
              <defaultCertificate findValue="d346n32d48938w43d943095d"
                                  storeLocation="CurrentUser"
                                  storeName="TrustedPeople"
                                  x509FindType="FindByThumbprint" />
              <authentication certificateValidationMode="None" revocationMode="NoCheck"/>

            </serviceCertificate>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
</behaviors>

嘗試在客戶端和服務器上指定相同的協議。 在客戶端添加以下代碼:

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

這是參考: TLS 1.2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM