[英]When does WCF NetTcpBinding need full trust on the client?
我正在使用WCF與多個服務器進行通信。
對於我的本地服務器netTcpBinding工作得像預期,沒有問題。
但是當我嘗試使用app.config
的以下netTcpBinding連接到我的遠程服務器(Azure)時,這將使應用程序在初始化時崩潰,因為如果沒有完全信任就無法創建netTcpBinding。
這個綁定在app.config
文件中,
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
這將導致此錯誤:
為“system.serviceModel / bindings”創建配置節處理程序時發生錯誤:該程序集不允許部分信任的調用方。 (K:\\ Somepath \\ Testing.exe.Config第6行)
奇怪的是:在app.config
文件中,我得到了連接到其他netTcpBindings的客戶端端點(沒有在綁定部分中明確地聲明它們)。
為什么這些通用的netTcpBindings部分信任,但我上面展示的那個不是?
或者我只是對此錯誤消息感到困惑,問題不在於完全信任?
更新:如果我刪除<binding>部分,這些東西將運行沒有問題。 所以我被允許在部分信任中使用netTcpBinding,但我不允許修改參數? 這很遺憾,因為我想在我的通信上加密某種形式的加密。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.