Question

We are busy with an application on a rasp pi where we retrieve a google calendar with the Google Calendar API. We wrote it in C# and tested it on Windows where i works fine. When we compile it on the Rasp PI (xbuild) we don't get any errors, but when we run (mono) it we get the following error:

Unhandled Exception: Google.GData.Client.GDataRequestException: Execution of request failed: http://www.google.com/calendar/feeds/USERNAME@gmail.com/private/full?start-min=2013-10-29T14:11:41Z ---> System.Net.WebException: The remote server returned an error: (401) Authorization required.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Google.GData.Client.GDataRequest.Execute () [0x00000] in <filename unknown>:0 
  at Google.GData.Client.GDataGAuthRequest.Execute (Int32 retryCounter) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: Google.GData.Client.GDataRequestException: Execution of request failed: http://www.google.com/calendar/feeds/USERNAME@gmail.com/private/full?start-min=2013-10-29T14:11:41Z ---> System.Net.WebException: The remote server returned an error: (401) Authorization required.
  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0 
  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Google.GData.Client.GDataRequest.Execute () [0x00000] in <filename unknown>:0 
  at Google.GData.Client.GDataGAuthRequest.Execute (Int32 retryCounter) [0x00000] in <filename unknown>:0 

Could someone help us, we don't see a solution.

Was it helpful?

Solution

We solved the authentification problem with running the following code:

mozroots --import --ask-remove

this is because Mono (by default) doesn't allow outside connections, so you have add it to the certificate list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top