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
Re: SecurityNegotiationException
От: Аноним  
Дата: 01.10.12 15:42
Оценка:
Здравствуйте, Аноним, Вы писали:

А>Доброго времени суток. Я новичок в 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>
А>



А>Короче мне нужно отключить безопасность.

А>Есть варианты?

Плхоже я забыл как гуглить
Ответ нашел по первой ссылке

Но все же интересуют еще мнения?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.