• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by nesdroc · Mar 04, 2015 at 05:52 AM · apigooglecertificatessldrive

Help me reading a spreadsheet from Google drive using the API

I'm trying to access a published Google spreadsheet using the Google Drive API. However, I run into the following issues w$$anonymous$$ch are elaborated below (my code is at the bottom),

  1. I. Running my project I receive the following error: TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a.

  2. Looking up the error leads me to having to call the mozroots.exe --import --sync

1) Running my project I receive the following error in Unity:

TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process () Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) Rethrow as IOException: The authentication or decryption has failed. Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) Rethrow as WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) System.Net.HttpWebRequest.GetResponse () Google.GData.Client.GDataRequest.Execute () Rethrow as GDataRequestException: Execution of request failed: https://docs.google.com/spreadsheets/d/1CTyUyDj-yTWb1GjUhEsWE0kS_h41qbfN31yHrU8I75g/pubhtml?gid=1124040655&single=true Google.GData.Client.GDataRequest.Execute () Google.GData.Client.GDataGAuthRequest.Execute (Int32 retryCounter)

2) Looking up the error leads me to "solutions" saying I should call the mozroots.exe --import --sync (supplied with monodevelop).

However I either receive:

Downloading from 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/ builtins/certdata.txt?raw=1'... Couldn't retrieve the file using the supplied information.

OR

Downloading from 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/ builtins/certdata.txt?raw=1'... Importing certificates into user store... Error: System.NullReferenceException: Object reference not set to an instance of an object. at Mono.Security.X509.X509Certificate.get_Hash() at Mono.Security.X509.X509CertificateCollection.IndexOf(X509Certificate value ) at Mono.Security.X509.X509CertificateCollection.Contains(X509Certificate valu e) at Mono.Tools.MozRoots.Process() at Mono.Tools.MozRoots.Main(String[] args)

My code for the API is:

 SpreadsheetsService service = new SpreadsheetsService("exampleCo-exampleApp-1");
 
 SpreadsheetQuery query = new SpreadsheetQuery("https://docs.google.com/spreadsheets/d/1CTyUyDj-yTWb1GjUhEsWE0kS_h41qbfN31yHrU8I75g/pubhtml?gid=1124040655&single=true");
 SpreadsheetFeed feed = service.Query(query);
 
 //Console.WriteLine("Your spreadsheets:");
 foreach (SpreadsheetEntry entry in feed.Entries)
 {
     //Console.WriteLine(entry.Title.Text);
     Debug.Log(entry.ToString());
 }
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hexagonius · Mar 04, 2015 at 09:08 AM 0
Share
avatar image nesdroc · Mar 21, 2015 at 11:22 AM 0
Share
avatar image hexagonius · Mar 21, 2015 at 01:01 PM 0
Share

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Simeon · May 08, 2016 at 11:42 PM

T$$anonymous$$s is because of Mono doesn't trust anyone.. You can force it to connect by using t$$anonymous$$s, every time you try to connect.

 public class UnsafeSecurityPolicy
 {
     public static bool Validator(object sender,X509Certificate certificate,X509Chain chain,SslPolicyErrors policyErrors)
     {
         //*** Just accept and move on...
         Debug.Log("Validation successful!");
         return true;
     }
 
     public static void Instate()
     {
         ServicePointManager.ServerCertificateValidationCallback = Validator;
     }
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Self signed SSL certificates for WWW class? 1 Answer

Tell UnityWebRequest to trust invalid SSL certs 1 Answer

modify given google API script to use phone gps location? 0 Answers

Is it possible to do ssl certificate pinning in Unity iOS 1 Answer

How can I add a certificate to the Mono Trust store? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges