2015-02-05 6 views
0

문제점이 있습니다. SSL을 통해 WCF 서비스에 클라이언트 인증서를 첨부하려고합니다. 브라우저를 통해 서비스로 이동하려고하면 '서비스 페이지를 만들었습니다'라는 메시지가 표시되지만 인증서를 첨부해야만 IIS 문제가 발생하지 않습니다.SSL을 통한 WCF 서비스 'test-service.hostname.com'권한으로 SSL/TLS에 대한 보안 채널을 설정할 수 없습니다.

나는 많은 오버 플로우 질문을 겪었고, 나는 조금씩 나아갈 때마다 생각한다. 그러나 나에게있어서 나는이 문제를 흔들어 놓을 수 없다. 내가 여기에 로그인하여 추가 된 것은 내가 오류에 대해보고하고 무엇 :

System.Net Information: 0 : [12444] SecureChannel#15775260 - Certificate 

is of type X509Certificate2 and contains the private key. 
System.Net Information: 0 : [12444] AcquireCredentialsHandle(package = Microsoft Unified Security Protocol Provider, intent = Outbound, scc  = System.Net.SecureCredential) 
System.Net Error: 0 : [12444] AcquireCredentialsHandle() failed with error 0X8009030D. 
System.Net Information: 0 : [12444] AcquireCredentialsHandle(package = 



Microsoft Unified Security Protocol Provider, intent = Outbound, scc  = System.Net.SecureCredential) 
System.Net Error: 0 : [12444] AcquireCredentialsHandle() failed with error 0X8009030D. 
System.Net.Sockets Verbose: 0 : [8000] Socket#13431269::Dispose() 
System.Net Error: 0 : [8000] Exception in HttpWebRequest#55386345:: - The request was aborted: Could not create SSL/TLS secure channel.. 
System.Net Error: 0 : [8000] Exception in HttpWebRequest#55386345::GetResponse - The request was aborted: Could not create SSL/TLS secure channel.. 
System.ServiceModel Error: 131075 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>/LM/W3SVC/1/ROOT/Application.TestHarness.Blah-1-130676061695261461</AppDomain><Exception><ExceptionType>System.ServiceModel.Security.SecurityNegotiationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Could not establish secure channel for SSL/TLS with authority 'test-bolt.homesite.com'.</Message><StackTrace> at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 
    at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type) 
    at Application.TestHarness.IntegrationService.QuickQuote() 

서비스 구성 :

<system.serviceModel> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="WebBehavior"> 
     <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

<services> 
    <service name="Service.Namwe" behaviorConfiguration="WebBehavior"> 
    <endpoint address="" 
       binding="wsHttpBinding" 
       bindingConfiguration="transportSecurity" 
       contract="Service.IContract"/> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
    </service> 
</services> 
<bindings> 
    <wsHttpBinding> 
    <binding name="transportSecurity"> 
     <security mode="Transport"> 
     <transport clientCredentialType="Certificate"/> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 

클라이언트 구성 :

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
    <binding name="transportSecurity"> 
     <security mode="Transport"> 
     <transport clientCredentialType="Certificate"/> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<behaviors> 
    <endpointBehaviors> 
    <behavior name ="defaultClientCertificate"> 
     <clientCredentials> 
     <clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="hostname.com"/> 
     </clientCredentials> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 
<client> 
    <endpoint name="boltService" behaviorConfiguration="defaultClientCertificate" 
      address="https://hostname.com/Service/Integration.svc" 
      binding="wsHttpBinding" 
      bindingConfiguration="transportSecurity" 
      contract="ServiceRef.IServiceContract" /> 
</client> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 

어떤 조언 ~ 될거야. 대단히 감사합니다.

+0

이 구성된 인증서, 당신은 이름의 개인 저장소에서 로컬 컴퓨터에서 인증서를 참조 스냅인을 열 때 그냥 확인하려면? –

+0

예 개인용으로 localmachine에서 볼 수 있으며 인증 된 인증서를 볼 때 실제 인증서를 구입 했으므로 –

+0

인증서가 클라이언트 인증으로 설정 되었습니까? –

답변

4

문제점이 무엇인지 알아 냈습니다. 서비스를 실행중인 App 풀에 인증서에 대한 액세스 권한이 없습니다. 나는 IIS에서 모든 응용 프로그램 풀이 액세스 할 수 있도록 붙어 있기 때문에 가정했습니다 (대소 문자가 아님). 누가 이것을 발견하고 simialar 문제가있는 경우에 내가 결국 발견 한 것과 그것을 고쳐 놓은 것이있다. https://msdn.microsoft.com/en-us/library/aa702621.aspx GUI가 cmd line tools 이상인 경우 MMC에서이 작업을 수행 할 수도 있습니다.

+0

FFS. 그 godforsaken'd 메시지가 암시하려고했던 것이 무엇인지 알아 내려고 노력하면서 이틀 동안 낭비했습니다. 다시 작성, 재발행, 새 인증서 필요 등 _thrice_. 그런 다음 AppPool ID를 네트워크 서비스 및 _poof_로 변경했습니다. –

0

이 코드에서는 동일한 문제와 해결 된 문제가 있습니다.

ServicePointManager.Expect100Continue = true; 
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; 

또는 노력이 코드

ServicePointManager.Expect100Continue = true; 
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;