Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 Curyous · Dec 02, 2013 at 08:05 AM · androidhttpwebrequesthttps

HttpWebRequest to https on Android?

What I'm doing is beyond the capability of WWW.

Sending an HttpWebRequest to an https URL works fine on iOS but on Android I get:

 System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.)

I can get past this error if I return true from a RemoteCertificateValidationCallback, but this is basically ignoring security, which doesn't seem like the right thing to do. I tried UniWeb and it just returns true too, it doesn't check anything.

Looking further into RemoteCertificateValidationCallback, it reports a PartialChain error, probably because it can't find any certificates to validate the one that it received on the server. Opening the X509Stores, there are 0 certificates under Current User and Local Machine.

What do you do to talk to web services over http on Android?

Comment
Add comment · Show 2
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 DimensionU · Aug 18, 2015 at 02:13 PM 0
Share

@Curyous: I know this is a really old thread, but I'm running into exactly this issue and searching answers yields almost exclusively WebPlayer target crossdomain policy issues. Like you, I'm targeting Android. Were you able to solve your problem?

avatar image Curyous · Aug 18, 2015 at 06:26 PM 0
Share

@DimensionU I solved it in the end by creating my own native plugin because you can do anything you want natively. If I was trying to solve that problem now I'd probably buy a cross-platform http solution from the Asset Store.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DimensionU · Aug 18, 2015 at 06:31 PM

Thanks, @Curyous! I've been using UniWeb, which is cross platform, but doesn't seem to be getting along with GET requests with custom headers used for authentication on Android (works fine on iOS, Mac, Windows and WebPlayer). I conditionally compiled so that if I'm on Android, I just use the WWW class and use UniWeb for other targets.

Comment
Add comment · Show 1 · 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
avatar image Curyous · Aug 18, 2015 at 07:02 PM 0
Share

@DimensionU Ah, that's probably why I wrote my own. I think there's another one called "Best Http" you could try, but I can't confirm that it works properly on Android.

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.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

WWW and SSL on Android 1 Answer

WWW with HTTPS on Android not working 0 Answers

Send POST request to HTTPS 1 Answer

HTTP Requests removed on Android Pie (API 28+) 2 Answers

Problems with HTTPS, HttpWebRequest, and iOS? 4 Answers


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