Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Can't connect with https to a cloudfront(amazon) server - authentication/decryption failed

Discussion in 'Connected Games' started by omrip32, Apr 13, 2016.

  1. omrip32

    omrip32

    Joined:
    Jan 4, 2016
    Posts:
    105
    Hi All :)
    I'm using the following code to to receive a response from a secured server (Unity version 5.2.3):

    WebClient client = new WebClient(); //I'm using this and not the 'WWW" class because I'm using threading for this).

    byte[] bytes = client.DownloadData("https://SomeSecuredServer");

    But I'm getting the following error:
    "Error getting response stream (Write: The authentication or decryption has failed.): SendFailure"

    A few things I've tried:

    1. initializing the 'ServicePointManager.ServerCertificateValidationCallback' and returning 'true' always in the delegate, but I'm still getting the error..
    2. using mono mozroots tool but to no avail, it crashes every time.
    3. using the certmgr tool to add the root certificate manually, it was added, but it didn't help as well.

    It's really important to note that when disabling cloudfront (and just using a regular server that supports https) the request succeeds!!
    So, I'm guessing this is due to some security issue in my request when using cloudfront.
    I really need your help people :confused::confused:

    Thanks;)
     
  2. omrip32

    omrip32

    Joined:
    Jan 4, 2016
    Posts:
    105
    By the way, when using the 'WWW' class this works.. Really strange.
     
  3. omrip32

    omrip32

    Joined:
    Jan 4, 2016
    Posts:
    105
    Well, it seems I'm answering myself but what the hell ;)
    I used wireshark to find out that after sending 'client hello' message I immediatly receive an 'handshake failure' response.
    Both of them support tls v1.0 and above, so that only leaves the cipher suites..
     
  4. omrip32

    omrip32

    Joined:
    Jan 4, 2016
    Posts:
    105
    Solved the problem!!!!!
    in AWS console , SNI only was enabled. For some reason the WebClient/WebRequest/etc.. classes do not support SNI.
     
  5. prasetion

    prasetion

    Joined:
    Apr 3, 2014
    Posts:
    11
    hey @omrip32 , currently i am working with aws services right now using unity, but only some services availble from aws for unity. And our backend programmer using cloudfront to generate private s3 url (for security reason), and when i find aws sdk for unity, there is no cloudfront sample or docs in aws page or github. So i conclude, for right now, i can not implement cloudfront in unity. But in .NET, all core are availble to implement. And i want to know, if unity can import aws core sdk from .NET to unity, because i think, in structure, unity part from .NET, and i think it is possible but i don't know how to do that. Maybe you have the answer. Thanks