2015-06-01 5 views
6

पर "प्रमाण पत्र कुंजी एल्गोरिदम समर्थित नहीं है" अपवाद का कारण क्या हो सकता है हम एक मानक वेबरेक्वेस्ट का उपयोग कर एएसपीनेट एमवीसी 4.6 ऐप से फेसबुक एपीआई से कनेक्ट करने का प्रयास कर रहे हैं। सब कुछ हमारे सर्वरों में से एक पर ठीक काम करता है। प्रश्न में सर्वर विंडोज 2012 और आईआईएस 8. चल रहा है 8.एक वेब वेब अनुरोध

इस विशेष सर्वर पर हमें फेसबुक पर जीईटी वेबरेक्व चलाने के दौरान निम्नलिखित अपवाद मिलता है।

The certificate key algorithm is not supported.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The certificate key algorithm is not supported.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: The certificate key algorithm is not supported.] System.Net.TlsStream.EndWrite(IAsyncResult asyncResult) +409 System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar) +213

[WebException: The underlying connection was closed: An unexpected error occurred on a send.]
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +894 System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) +92

[HttpRequestException: An error occurred while sending the request.]
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +96 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +49

कोड इस तरह दिखता है:

// Request 
    private static async Task<T> Request<T>(string url) where T : class 
    { 
     using (var handler = new WebRequestHandler()) 
     { 
      handler.ServerCertificateValidationCallback = delegate { return true; }; 
      using (var client = new HttpClient(handler) { Timeout = System.TimeSpan.FromSeconds(20) }) 
      { 
       client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 
       var result = await client.GetAsync(url); 
       if (result == null) return null; 
       var model = await result.Content.ReadAsAsync<T>(); 
       return model; 
      } 
     } 
    } 

हम क्यों यह सब हमारे सर्वरों में से एक है, लेकिन पर काम करता है के रूप में हमारे सिर खरोंच कर रहे हैं।

क्या किसी के पास कोई भी विचार है जो इस त्रुटि का कारण बन सकता है और इसे कैसे हल किया जा सकता है।

धन्यवाद।

+0

ऐसा प्रतीत होता है जब यह साइट उनके प्रमाणपत्र में ईसीसी (अंडाकार वक्र क्रिप्टोग्राफी) का उपयोग करती है। – herostwist

उत्तर

6

मैं समस्या को दोहराने में कामयाब रहा और यह नेटवर्क ट्रेसिंग में बग प्रतीत होता है जो X509Certificate2.ToString (true) को सेट करने के लिए बनाता है जो इंटर्न अपवाद फेंकता है।

मुझे मिला एकमात्र समाधान पूरे 'सिस्टम। डायनेटिक्स' अनुभाग को हटाना है जो लॉगिंग को अक्षम कर देगा।

+1

धन्यवाद, हमने herostwist

+2

बिज़ारे को हटाने के लिए इसे कम कर दिया। मैंने लॉग अक्षम कर दिया है और अपवाद चला गया है ... क्या एक अद्भुत बीसीएल :) –

+0

आपने वास्तव में कौन से लॉग हटा दिए और कहां गए? –

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