Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Marc · Jan 16, 2018 at 10:51 AM · unity3dsdks

Connection errors when migrating to Unity 2017.3

Hi,

We are migrating our project from Unity 5.5 to Unity 2017.3, but now we are getting login errors with PlayFab in the Unity Console.

WebException: Error writing request: The authentication or decryption has failed.
System.Net.WebConnectionStream.WriteHeaders ()
System.Net.WebConnectionStream.SetHeaders (System.Byte[] buffer)(wrapper remoting-invoke-with-check) 
System.Net.WebConnectionStream:SetHeaders (byte[])
System.Net.HttpWebRequest.SendRequestHeaders (Boolean propagate_error)
Rethrow as WebException: Error: SendFailure (Error writing request: The authentication or decryption has failed.)
System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult)
System.Net.HttpWebRequest.GetRequestStream ()
PlayFab.Internal.PlayFabWebRequest.Post (PlayFab.Internal.CallRequestContainer reqContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:189)
Rethrow as WebException: SendFailure: WebException making http request to: https://8FF3.playfabapi.com/Client/LoginWithCustomIDUnityEngine.Debug:LogException(Exception)
PlayFab.Internal.PlayFabWebRequest:Post(CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:202)
PlayFab.Internal.PlayFabWebRequest:WorkerThreadMainLoop() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:122)
SendFailure: WebException making http request to: https://8FF3.playfabapi.com/Client/LoginWithCustomID
UnityEngine.Debug:LogError(Object)
PlayFabLogin:OnLoginFailure(PlayFabError) (at Assets/PlayFabLogin.cs:22)
PlayFab.Internal.<QueueRequestError>c__AnonStorey0:<>m__0() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:265)
PlayFab.Internal.PlayFabWebRequest:Update() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:346)
PlayFab.Internal.PlayFabHttp:Update() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs:279)

PlayFab SDK plugin version is 2.34.180102 and our code is the same in both Unity versions.

The PlayfabSharedSettings asset is correctly configured (using the PlayFab Editor Extension) and using Request Type "Http Web Request" as before.

We tested in a dumb project in Unity 2017.3, only with the PlayFab plugin and using the same script as the "Unity Get Started" tutorial. Same errors on login.

I read here about the WWW regressions on the Unity 2017 versions, and you recomend to use HttpWebRequest (with no compression) but the thing is that we are already using HttpWebRequest.

Thank you

Comment

People who like this

0 Show 1
10 |1200 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 alcomsoftstr · Jan 21, 2018 at 01:37 PM 0
Share

On Unity 5.6.1p4 error too. And in Safari (iOS), open playfabapi site - worning certificate. For Editor and Android - all ok

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by 1807605288 · Jan 16, 2018 at 10:55 PM

The cause of the issue you're seeing is due to poor testing on our side.

We discovered a security vulnerability with our HttpWebRequest solution, and attempted to patch it.

https://github.com/PlayFab/SDKGenerator/commit/caac06b86d76acd3113bb6eb82ce0df94e910842

Unfortunately, it wasn't properly tested, and it turns out that HttpWebRequest no longer accepts ANY TLS certificate, including our own.

I've spent the last hour on stack overflow looking into this issue, and there does not seem to be any obvious correct solution (I attempted several answers that seemed promising, but they didn't solve the problem).

What can you do:

  1. You can use Unity WWW with compression turned off. (The suggestions in the answer you linked were each independent suggestions, which you can try one at a time).
  2. You can try the new UnityWebRequest option, which was published after the previous round of suggestions were written (also with compression turned off).
  3. You can un-do the security "fix" that I linked above in your local code, and accept all TLS certificates, and continue using HttpWebRequest. (I don't suggest this option, it leaves your players exposed to man-in-the-middle attacks).

I apologize for this mess up. We will endeavor to improve our automated testing in this category, but for now, we don't have a "good" solution for you if you're using HttpWebRequest.

Comment

People who like this

0 Show 1 · Share
10 |1200 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 Marc · Jan 17, 2018 at 11:01 AM 0
Share

Hi Paul,

Thanks for your answer.

For now, we are delaying our migration to Unity 2017.3. Too many problems when building on the game, weird crashes and little time to solve it... (not related to PlayFab plugin)

When we take it back, we will check your solutions or maybe a new plugin version update will be available.

Thanks again

Marc

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.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    Unity Download Content from CDN before Log-in,Download content with CDN before login 1 Answer

    OAuth consent screen and Playfab: Can't verify because I don't own playfab.com domain 3 Answers

    Catalog's Item Custom Data 1 Answer

    What happened to the OneSignal addon? (having iOS push errors with PlayFab) 1 Answer

    Unity Download Content from CDN before Log-in 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges