2016-02-25 11 views
14

मैं किसी अन्य पक्ष को बोल रहा हूँ और जब मैं एक प्रतिक्रिया के लिए पूछना यह एक अपवाद है कि कहते हैंप्रमाणीकरण विफल क्योंकि दूरस्थ पार्टी परिवहन स्ट्रीम अपवाद है जब वेब सेवा

"प्रमाणीकरण बाहर फेंक से एक प्रतिक्रिया हो रही बंद कर दिया है विफल रहा क्योंकि रिमोट पार्टी ने ट्रांसपोर्ट स्ट्रीम अपवाद बंद कर दिया है "।

मुझे लगता है कि प्रमाण पत्र भेजने में कोई समस्या है। मैंने नए प्रमाण-पत्रों की आपूर्ति करने की भी कोशिश की है। यहाँ पूर्ण कोड

 string get_url = "https://**.*******.com/com/******/webservices/public_webservice.cfc?wsdl&Method=CreateUser&SiteID=**&WSPassword=******&UserName=******"; 
     HttpWebRequest request = (HttpWebRequest)WebRequest.Create(get_url); 
     request.MaximumAutomaticRedirections = 4; 
     request.MaximumResponseHeadersLength = 4; 
     request.Credentials = CredentialCache.DefaultCredentials; 
     //request.UseDefaultCredentials = false; 
     //request.Credentials = new System.Net.NetworkCredential("*****", "*****"); 
     request.ContentType = "application/x-www-form-urlencoded; charset=ISO-8859-1"; 

     // Show the sent stream 
     //lbl_send_stream.Text = send_stream; 
     //lbl_send_stream.Text = get_url; 
     // Get UserId And LoginToken From Third Party DB 
     // ============================================== 
     //Exception gets throwed When code hits here 
     HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 

enter image description here

+1

http://stackoverflow.com/questions/19639846/failure-on-httpwebrequest-with-inner-exception-authentication-failed-because-the –

+0

मैंने कोशिश की है कि, यह समस्या का समाधान नहीं है। –

उत्तर

40

मैं इस सवाल का जवाब मिल गया है, यह था क्योंकि तृतीय पक्ष वेब सेवा हम बुला रहे थे TLS 1.0 का समर्थन नहीं किया है कि वे 1.1 और 1.2 का समर्थन किया। तो मुझे सुरक्षा प्रोटोकॉल बदलना पड़ा।

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; 
+1

मैं उस कोड pls कहां जोड़ सकता हूं? –

+2

अनुरोध से HTTPResponse प्राप्त करने से पहले आप इसे जोड़ सकते हैं। –

+0

मेरा सुरक्षाप्रोटोकॉल टाइप टीएलएस 12 और टीएलएस 11 के लिए विकल्प नहीं दिखाता है। मैं .NET Framework का उपयोग कर रहा हूं 4. –

संबंधित मुद्दे