flickr-downloadr / flickr-downloadr-gtk

A cross-platform desktop app, written in Mono that would download (all or selected) photos from your photostream in their selected size along with their description, title and tags.
https://flickrdownloadr.com/
MIT License
180 stars 41 forks source link

Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a (with solution) #5

Closed fotog closed 10 years ago

fotog commented 10 years ago

I have tried Flickr Downloadr with lubuntu 64 bit, i have installed the deb package.

I have found out the install is in /opt/flickrdownloadr, so i have changed dir to /opt/flickrdownloadr

Here is what i obtain:

/opt/flickrdownloadr$ ./flickrdownloadr

Unhandled Exception: DotNetOpenAuth.Messaging.ProtocolException: Web request to 'https://api.flickr.com/services/rest' failed. ---> 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.RemoteValidation (Mono.Security.Protocol.Tls.ClientContext context, AlertDescription description) [0x00000] in :0 at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in :0 at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in :0 at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in :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 :0 at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in :0 --- End of inner exception stack trace --- at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in :0 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in :0 at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in :0 at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetRequestStreamCore (System.Net.HttpWebRequest request) [0x00000] in :0 --- End of inner exception stack trace --- at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetRequestStreamCore (System.Net.HttpWebRequest request) [0x00000] in :0 at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetRequestStream (System.Net.HttpWebRequest request, DirectWebRequestOptions options) [0x00000] in :0 at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetRequestStream (System.Net.HttpWebRequest request) [0x00000] in :0 at DotNetOpenAuth.Messaging.Channel.SendParametersInEntity (System.Net.HttpWebRequest httpRequest, IDictionary2 fields) [0x00000] in <filename unknown>:0 at DotNetOpenAuth.Messaging.Channel.InitializeRequestAsPost (IDirectedProtocolMessage requestMessage) [0x00000] in <filename unknown>:0 at DotNetOpenAuth.OAuth.ChannelElements.OAuthChannel.CreateHttpRequest (IDirectedProtocolMessage request) [0x00000] in <filename unknown>:0 at DotNetOpenAuth.OAuth.ChannelElements.OAuthChannel.InitializeRequest (IDirectedProtocolMessage request) [0x00000] in <filename unknown>:0 at DotNetOpenAuth.OAuth.ConsumerBase.PrepareAuthorizedRequest (DotNetOpenAuth.Messaging.MessageReceivingEndpoint endpoint, System.String accessToken, IDictionary2 extraData) [0x00000] in :0 at FloydPink.Flickr.Downloadr.OAuth.OAuthManager.PrepareAuthorizedRequest (IDictionary2 parameters) [0x00000] in <filename unknown>:0 at FloydPink.Flickr.Downloadr.OAuth.OAuthManager+<MakeAuthenticatedRequestAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[System.Object].GetResult () [0x00000] in :0 at FloydPink.Flickr.Downloadr.Logic.LoginLogic+casync0.MoveNext () [0x00000] in :0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0 at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00000] in :0 at FloydPink.Flickr.Downloadr.Presentation.LoginPresenter+casync0.MoveNext () [0x00000] in :0

The problem can be solved used the following command (thanks to the developer for suggesting me this):

mozroots --import --ask-remove

floydpink commented 10 years ago

This happens because the default installation of mono does not trust any certificates as detailed in the FAQ:Security page on the mono website.

And as @fotog has mentioned in the issue, importing the root certificates using mozroots tool will help resolve the issue - specifically with this command:

mozroots --import --ask-remove