서비스 호출시 HttpWebRequest, HttpWebResponse 에 대한 인증 오류 해결 방법


인스타그램 Open API 를 이용하기 위하여 일반적인 방법으로 HttpWebRequest, HttpWebResponse 를 이용하였지만 아래와 같은 에러가 났다.



에러내용 

System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a

  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0 

  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in <filename unknown>:0 

  at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in <filename unknown>:0 

  at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()

  at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0 

  at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 

  --- End of inner exception stack trace ---

  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 

  --- End of inner exception stack trace ---

  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 

  at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0 

  at InstagramManager+<SingleRunToSearchTag>c__AnonStorey5.<>m__0 () [0x00091] in 





해결방법은 간단히 아래의 명령을 시작시 해주면 된다.


ServicePointManager.ServerCertificateValidationCallback = (p1, p2, p3, p4) => true;

Yamecoder 야매코더_
unity3d 2015.07.23 15:07
Powerd by Tistory, designed by criuce
rss