잘 작동하는 IIS (7.5)에 wcf 서비스를 호스트했습니다. 이제 사용자 이름 인증을 추가하고 몇 가지 문제가 발생합니다.WCF 문제 - 사용자 이름 인증 및 전송 WithMessageCredentials를 사용하는 wsHttpBinding
1) makecert -n "CN = RootCATest"-r -sv RootCATest : 내가이 (MSDN에서 영감) 다음 한 인증서에 대해서는
<system.serviceModel> <services> <service behaviorConfiguration="warServBehavior" name="WcfServiceLibrary.WarcraftService"> <endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary.IWarcraftService" bindingConfiguration="warWsHttpBinding" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> </service> </services> <bindings> <wsHttpBinding> <binding name="warWsHttpBinding"> <security mode="TransportWithMessageCredential"> <transport clientCredentialType="None"/> <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="warServBehavior"> <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true"/> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="BogusValidator, App_Code"/> </serviceCredentials> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
: 구성 파일이 있습니다. PVK RootCATest.cer는
2) 신뢰할 수있는 루트 인증 기관
- 3) makecert -sk CertTest -iv RootCATest.pvk -n "CN = 가짜"-ic RootCATest.cer에 추가
내가 https://localhost/WarcraftServiceSite/WarService.svc는 svcutil 실행하면 나는이 예외가 내 -sky 교환 -ss -SR localmachine은 -pe IIS에서
은 내가 HTTPS과 내가이 문제를 가지고있는 서버 인증서 바인딩 추가 : "There was an error downloading https://localhost/WarcraftServiceSite/WarService.svc. The underlying connection was closed.Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure."
나중에 편집 :는 svcutil를 호출하는 올바른 방법은 http 것 같다 https 아님 내가 가진 경우에도이 <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />