question

Dominic Hamelin-Blais avatar image
Dominic Hamelin-Blais asked

An SSL error has occurred and a secure connection to the server cannot be made.

Hi, when using LoginWithIOSDeviceID or LoginWithAndroidDeviceID, I'm sometime having connection issues (see logs below.) This does not happen 100% of the time. I'd say, 9 times out of 10, everything is fine.


I'm using Unity Web Request, on the latest PlayFab Unity SDK (v 2.89.200629)
Unity version 2019.4.1f1.

I'm sometimes seeing this error (without callstack and much information) when running my game in Editor: Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH, not sure if its related?

Anyone has an idea of what could be the problem?


Here's the detailed logs from an iOS device:

Task <834717A8-331E-47FE-B4F3-D40BCDD0E0F8>.<13> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=(
    "<cert(0x125218e00) s: *.us-west-2.es.amazonaws.com i: Amazon>",
    "<cert(0x125219600) s: Amazon i: Amazon Root CA 1>",
    "<cert(0x125219e00) s: Amazon Root CA 1 i: Starfield Services Root Certificate Authority - G2>",
    "<cert(0x125009000) s: Starfield Services Root Certificate Authority - G2 i: Starfield Class 2 Certification Authority>"
), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://c986.playfabapi.com/Client/LoginWithIOSDeviceID?sdk=UnitySDK-2.89.200629, NSErrorFailingURLStringKey=https://c986.playfabapi.com/Client/LoginWithIOSDeviceID?sdk=UnitySDK-2.89.200629, NSUnderlyingError=0x282f821f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x2811870f0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x125218e00) s: *.us-west-2.es.amazonaws.com i: Amazon>",
    "<cert(0x125219600) s: Amazon i: Amazon Root CA 1>",
    "<cert(0x125219e00) s: Amazon Root CA 1 i: Starfield Services Root Certificate Authority - G2>",
    "<cert(0x125009000) s: Starfield Services Root Certificate Authority - G2 i: Starfield Class 2 Certification Authority>"
)}}, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <834717A8-331E-47FE-B4F3-D40BCDD0E0F8>.<13>"
), _kCFStreamErrorCodeKey=-9802, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <834717A8-331E-47FE-B4F3-D40BCDD0E0F8>.<13>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x2811870f0>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.}
,

Hi, when using LoginWithIOSDeviceID or LoginWithAndroidDeviceID, I'm sometime having connection issues (see logs below.) This does not happen 100% of the time. I'd say, 9 times out of 10, everything is fine.

I'm using Unity Web Request, on the latest PlayFab Unity SDK (v 2.89.200629)
Unity version 2019.4.1f1.

I'm sometimes seeing this error (without callstack and much information) when running my game in Editor: Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH, not sure if its related?

Anyone has an idea of what could be the problem?


Here's the detailed logs from an iOS device:

Task <834717A8-331E-47FE-B4F3-D40BCDD0E0F8>.<13> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=(
    "<cert(0x125218e00) s: *.us-west-2.es.amazonaws.com i: Amazon>",
    "<cert(0x125219600) s: Amazon i: Amazon Root CA 1>",
    "<cert(0x125219e00) s: Amazon Root CA 1 i: Starfield Services Root Certificate Authority - G2>",
    "<cert(0x125009000) s: Starfield Services Root Certificate Authority - G2 i: Starfield Class 2 Certification Authority>"
), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://c986.playfabapi.com/Client/LoginWithIOSDeviceID?sdk=UnitySDK-2.89.200629, NSErrorFailingURLStringKey=https://c986.playfabapi.com/Client/LoginWithIOSDeviceID?sdk=UnitySDK-2.89.200629, NSUnderlyingError=0x282f821f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x2811870f0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x125218e00) s: *.us-west-2.es.amazonaws.com i: Amazon>",
    "<cert(0x125219600) s: Amazon i: Amazon Root CA 1>",
    "<cert(0x125219e00) s: Amazon Root CA 1 i: Starfield Services Root Certificate Authority - G2>",
    "<cert(0x125009000) s: Starfield Services Root Certificate Authority - G2 i: Starfield Class 2 Certification Authority>"
)}}, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <834717A8-331E-47FE-B4F3-D40BCDD0E0F8>.<13>"
), _kCFStreamErrorCodeKey=-9802, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <834717A8-331E-47FE-B4F3-D40BCDD0E0F8>.<13>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x2811870f0>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.}
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

Does it occur when you deploy the build to the device?

0 Likes 0 ·
Dominic Hamelin-Blais avatar image Dominic Hamelin-Blais Seth Du ♦ commented ·

Yes, I have seen the error on device too (iOS and Android.)
Also, when it occurs, the request is pretty long, like 6 to 8 seconds because the calls failed and returns the error.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

In terms of this phenomenon, there is a possibility that it is caused by the network connection issue. The request HTTP call has been corrupted or partially missing some information during the transmission. RESTful API cannot guarantee 100% success, and you may try to add try-catch sentences in the client to make sure there is another attempt of login when this issue occurs to help improve the robustness.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.