SecurityNegotiationException
От: Аноним  
Дата: 01.10.12 15:31
Оценка:
Доброго времени суток. Я новичок в WCF. Написал приложение. Есть сервис и графическая оболочка к нему (реализовано через netNamedPipeBinding), а также клиенты (реализованы через netTcpBinding).
При развертывании в локальной сети возникает исключение:
System.ServiceModel.Security.SecurityNegotiationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message:
A security requirement was not fulfilled during authentication. Required: Sign, negotiated: EncryptAndSign.
(это данные трассировки)
Конфиг сервера:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
    <bindings>
        <netNamedPipeBinding>
            <binding name="NetNamedPipeBinding_IWCFControl" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
                maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="Transport">
                    <transport protectionLevel="EncryptAndSign" />
                </security>
            </binding>
        </netNamedPipeBinding>

        <!--<netTcpBinding>
            <binding name="NetTcpBinding_IWCFDataTransport" 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="Windows" protectionLevel="EncryptAndSign" />
                    <message clientCredentialType="Windows" />
                </security>
            </binding>
        </netTcpBinding>-->

    </bindings>
    <client>

        <!--<endpoint address="net.tcp://localhost/service/transport" binding="netTcpBinding"
            bindingConfiguration="NetTcpBinding_IWCFDataTransport" contract="ServiceReference.IWCFDataTransport"
            name="NetTcpBinding_IWCFDataTransport">
            <identity>
                <userPrincipalName value="sergey-PC\sergey" />
            </identity>
        </endpoint>-->

        <endpoint address="net.pipe://localhost/service/control" binding="netNamedPipeBinding"
            bindingConfiguration="NetNamedPipeBinding_IWCFControl" contract="ServiceReference.IWCFControl"
            name="NetNamedPipeBinding_IWCFControl">
            <identity>
                <userPrincipalName value="sergey-PC\sergey" />
            </identity>
        </endpoint>
    </client>
    <services>
      <service name="kasatka_service.service" behaviorConfiguration="serviceMEXBehiavor">
        <endpoint address="net.tcp://localhost/service/transport" binding="netTcpBinding" contract="kasatka_service.IWCFDataTransport" />
        <endpoint address="net.pipe://localhost/service/control" binding="netNamedPipeBinding" contract="kasatka_service.IWCFControl" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/service" />
          </baseAddresses>
        </host>
      </service>
    </services>
      <behaviors>
        <serviceBehaviors>
          <behavior name="serviceMEXBehiavor">
            <serviceMetadata httpGetEnabled="true"/>
          </behavior>
        </serviceBehaviors>
      </behaviors>
  </system.serviceModel>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>


Конфиг клиента:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <system.serviceModel>
    <bindings>

      <!--<netNamedPipeBinding>
        <binding name="NetNamedPipeBinding_IWCFControl" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="Transport">
            <transport protectionLevel="EncryptAndSign" />
          </security>
        </binding>
      </netNamedPipeBinding>-->

      <netTcpBinding>
        <binding name="NetTcpBinding_IWCFDataTransport" 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="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="net.tcp://127.0.0.1/service/transport" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IWCFDataTransport" contract="ServiceReference.IWCFDataTransport" name="NetTcpBinding_IWCFDataTransport">
        <identity>
          <userPrincipalName value="sergey-PC\sergey" />
        </identity>
      </endpoint>

      <!--<endpoint address="net.pipe://localhost/service/control" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IWCFControl" contract="ServiceReference.IWCFControl" name="NetNamedPipeBinding_IWCFControl">
        <identity>
          <userPrincipalName value="sergey-PC\sergey" />
        </identity>
      </endpoint>-->

    </client>
  </system.serviceModel>
</configuration>



Короче мне нужно отключить безопасность.
Есть варианты?
.net wcf
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.