के लिए असफल होने की जांच में आईआईएस में होस्ट की गई डब्ल्यूसीएफ सेवा के लिए एक नया बाध्यकारी विकसित करने पर काम कर रहा हूं, मैंने सोचा कि मुझे सबकुछ मिल रहा है, लेकिन यह पता चला है कि क्लाइंट केवल तभी काम करता है जब क्लाइंट लक्ष्यीकरण नेट ढांचा 4.5, अगर मैं तो मैं निम्नलिखित त्रुटि मिलती है 4.6 लक्षित करने के लिए जब मैं एक कनेक्शन को खोलने का प्रयास इसे बदल:WCF SslStreamSecurity DNS पहचान जांच केवल 4.6 फ्रेमवर्क
System.ServiceModel.Security.MessageSecurityException occurred
HResult=-2146233087
Message=The Identity check failed for the outgoing message. The remote endpoint did not provide a domain name system (DNS) claim and therefore did not satisfied DNS identity 'xxx.domain.local'. This may be caused by lack of DNS or CN name in the remote endpoint X.509 certificate's distinguished name.
Source=System.ServiceModel
StackTrace:
at System.ServiceModel.Security.IdentityVerifier.EnsureIdentity(EndpointAddress serviceReference, AuthorizationContext authorizationContext, String errorString)
मैं अन्य की तुलना में अपने परीक्षण कोड में लक्ष्य ढांचे पर वापस जाने के कुछ नहीं करते हैं 4.5, तो यह ठीक काम करता है। यह मैं लगता है कि यह नेट 4.6 में एक बग हो सकता है, मुझे पता है Wcf ssl changes made in 4.6
पहला मौका अपवादों के साथ मैं निम्नलिखित अपवाद है कि System.ServiceModel में
System.ArgumentNullException occurred
HResult=-2147467261
Message=Value cannot be null.
Parameter name: value
ParamName=value
Source=mscorlib
StackTrace:
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
InnerException:
System.ServiceModel.dll!System.ServiceModel.Security.IssuanceTokenProviderBase<System.ServiceModel.Security.Tokens.IssuedSecurityTokenProvider.FederatedTokenProviderState>.DoNegotiation(System.TimeSpan timeout) Unknown System.ServiceModel.dll!System.ServiceModel.Security.IssuanceTokenProviderBase<System.ServiceModel.Security.Tokens.IssuedSecurityTokenProvider.FederatedTokenProviderState>.GetTokenCore(System.TimeSpan timeout) Unknown
System.IdentityModel.dll!System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Security.Tokens.IssuedSecurityTokenProvider.GetTokenCore(System.TimeSpan timeout) Unknown
System.IdentityModel.dll!System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Security.SecurityProtocol.TryGetSupportingTokens(System.ServiceModel.Security.SecurityProtocolFactory factory, System.ServiceModel.EndpointAddress target, System.Uri via, System.ServiceModel.Channels.Message message, System.TimeSpan timeout, bool isBlockingCall, out System.Collections.Generic.IList<System.ServiceModel.Security.SupportingTokenSpecification> supportingTokens) Unknown
System.ServiceModel.dll!System.ServiceModel.Security.TransportSecurityProtocol.SecureOutgoingMessageAtInitiator(ref System.ServiceModel.Channels.Message message, string actor, System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Security.TransportSecurityProtocol.SecureOutgoingMessage(ref System.ServiceModel.Channels.Message message, System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Security.SecurityProtocol.SecureOutgoingMessage(ref System.ServiceModel.Channels.Message message, System.TimeSpan timeout, System.ServiceModel.Security.SecurityProtocolCorrelationState correlationState) Unknown
System.ServiceModel.dll!System.ServiceModel.Channels.SecurityChannelFactory<System.ServiceModel.Channels.IRequestChannel>.SecurityRequestChannel.Request(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Channels.TransactionRequestChannelGeneric<System.ServiceModel.Channels.IRequestChannel>.Request(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Dispatcher.RequestChannelBinder.Request(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.Call(string action, bool oneway, System.ServiceModel.Dispatcher.ProxyOperationRuntime operation, object[] ins, object[] outs, System.TimeSpan timeout) Unknown
System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(System.Runtime.Remoting.Messaging.IMethodCallMessage methodCall, System.ServiceModel.Dispatcher.ProxyOperationRuntime operation) Unknown
System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannelProxy.Invoke(System.Runtime.Remoting.Messaging.IMessage message) Unknown
mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) Unknown
आंतरिक रूप से उठाया है देखना चालू थे बनाता है जिस डब्ल्यूसीएफ सेवा को सूचित किया जा रहा है वह 4.6 को लक्षित कर रहा है, और जहां तक मैं कह सकता हूं कि मैं डीएनएस पहचान निर्दिष्ट कर रहा हूं, जो कि प्रमाण विषय में सीएन = के रूप में मौजूद है। बाध्यकारी एक कस्टम बाध्यकारी है ताकि मैं संघीय net.tcp कर सकूं, क्लाइंट कोड में सबकुछ बनाता है और मैं दृश्य स्टूडियो में सेवा सेवा सुविधा का उपयोग नहीं करता, क्लाइंट कोड जो बाध्यकारी बना रहा है:
var binding = new CustomBinding(new BindingElement[] {
new TransactionFlowBindingElement(),
security,
new SslStreamSecurityBindingElement(),
new BinaryMessageEncodingBindingElement() {
ReaderQuotas = { MaxDepth = maxReceivedSizeBytes, MaxStringContentLength = maxReceivedSizeBytes, MaxArrayLength = maxReceivedSizeBytes, MaxBytesPerRead = maxReceivedSizeBytes, MaxNameTableCharCount = maxReceivedSizeBytes },
},
new TcpTransportBindingElement {
TransferMode = TransferMode.StreamedResponse,
MaxReceivedMessageSize = maxReceivedSizeBytes,
},
}) {
SendTimeout = sendTimeout,
};
var channelFactory = new ChannelFactory<T>(binding, new EndpointAddress(new Uri(url), EndpointIdentity.CreateDnsIdentity("xxx.domain.local"), new AddressHeader[0]));
क्या 4.6 फ्रेमवर्क में यह एक बग हो सकता है जिससे विभिन्न व्यवहार हो? क्या अगले चरण केवल फ्रेमवर्क कोड को चरणबद्ध करने और डीबग करने का प्रयास कर रहे हैं, यह जानने के लिए कि 4.6 अलग-अलग व्यवहार क्यों कर रहा है?
संपादित करें - मैं एक small sample project that demonstrates the error बनाया, रेप्रो कदम हैं:
- (वी.एस. 2015 का उपयोग करना) खोलें WcfSelfHostedServer समाधान
- आपके स्थानीय कंप्यूटर पर IdentityFail.pfx प्रमाणपत्र जोड़ें, व्यक्तिगत दुकान एमएमसी
- भागो WcfSelfHostedServer परियोजना (संभावना पर क्लिक फ़ायरवॉल हाँ अनुमति देने के बंदरगाह 30000)
- ओपन WcfClient समाधान 012,351,641 का उपयोग कर
- ठीक है, परियोजना> गुण पर क्लिक करें ध्यान दें कि यह लक्ष्यीकरण है 4.6.1
- भागो परियोजना, यह अपवाद ऊपर
- अब 4.5.2 लक्षित करने के लिए ग्राहक के लिए स्विच वर्णित फेंक, यह कोई साथ ठीक चलेगा त्रुटियों
अपडेट - मैं निम्नलिखित है कि संबंधित दिखाई पाया: https://support.microsoft.com/en-us/kb/3069494 https://msdn.microsoft.com/en-us/library/mt298998(v=vs.110).aspx
लेकिन निर्दिष्ट करने सर्वर और ग्राहक पर Tls12 समस्या का समाधान नहीं है, और भी DontEnableSchUseStrongCrypto = सच ध्वज जोड़ने डीएनएस पहचान जाँच त्रुटि भले ही यह Enum.Parse आंतरिक त्रुटि कि was being thrown from this line
किसी कारण से यह काम किया और app.config परिवर्तन नहीं हुआ। – Jazaret
मुझे एक ही चीज़ का सामना करना पड़ रहा है। मैंने web.config के 'रनटाइम' अनुभाग में स्विच सेट किया है, लेकिन यह लागू नहीं होता है। कोड कोड में इसे सेट करना, हालांकि (और मेरे लिए समस्या को हल करता है)। मेरे पास उस समय इसका समाधान नहीं है ... बस सोचा कि मैं इसमें झुकाऊंगा। – erlingormar