0

我去过几个关于如何纠正这个错误的网站,但无法摆脱这个错误。我将它托管在启用 SSL 的 IIS 6 上。下面是我的配置

 <services>
            <service behaviorConfiguration="UsernamePasswordBehavior" name="DataServices.BEService">    

                <endpoint address="mex" binding="mexHttpsBinding" name="mex" contract="IMetadataExchange"  listenUri="https://mysite/beservice.svc"/>

                <endpoint address="wsbe" binding="wsHttpBinding" bindingConfiguration="wsHttpWithUsernamePassword"
                    name="BEwsHttp" contract="DataServices.IBEService" listenUri="https://mysite/beservice.svc" />               
            </service>
</services>

    <bindings>          
        <wsHttpBinding>
                    <binding name="wsHttpWithUsernamePassword" sendTimeout="00:06:00"  receiveTimeout="00:06:00">
                        <security mode="Message">
                            <message clientCredentialType="UserName"/>
                            </security>                    
                    </binding>
            </wsHttpBinding>
        </bindings>


     <behaviors>
                <serviceBehaviors>
                   <behavior name="UsernamePasswordBehavior">
                        <serviceMetadata httpsGetEnabled="true"/>
                        <serviceDebug includeExceptionDetailInFaults="true" />                    
                        <serviceCredentials>
                            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="DataServices.CustomUsernameValidator, DataServices" />
                            <serviceCertificate findValue="*.mysite.com" storeLocation="LocalMachine" storeName="My"  x509FindType="FindBySubjectName"/>                        
                        </serviceCredentials>                                      
                    </behavior>                
                </serviceBehaviors>
            </behaviors>

希望有人能帮忙!

4

2 回答 2

0

听起来您托管的 IIS 网站实例仅配置为 HTTPS (SSL)。右键单击网站实例并选择“编辑绑定...”。您看到那里列出了端口 80(纯 HTTP)吗?还要检查“SSL 设置”功能以确保“始终需要”选项未打开。- 取自堆栈溢出本身。当您在配置中仅使用消息安全性时,它可以工作,必须有一个非 HTTPS/SSL 地址绑定到该站点。当您在本地计算机上使用自签名证书时,您的代码是否有效?

于 2012-11-09T09:44:10.650 回答
0

我认为你需要使用

<security mode="TransportWithMessageCredential">

对于您的安全模式,而不是 Message ?

于 2012-11-12T13:54:19.700 回答