Failed to subscribe to topic Error Domain=NSURLErrorDomain Code=-1200
[REQUIRED] : Describe the problem
Hi Team, With iOS 11 and XCode 9 we are getting below errors
Error 1 Failed to subscribe to topic Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9802, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x1c0449f00 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://iid.googleapis.com/iid/register, NSErrorFailingURLStringKey=https://iid.googleapis.com/iid/register, _kCFStreamErrorDomainKey=3}
Error 2 TIC TCP Conn Failed [3:0x6040003627c0]: 3:-9802 Err(-9802) 2017-10-10 12:51:47.059149+0530 MyApp[11781:227385] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) 2017-10-10 12:51:47.059353+0530 MyApp[11781:227385] Task <91287390-CC8A-4F32-8403-929E95353B4B>.<1> HTTP load failed (error code: -1200 [3:-9802]) 2017-10-10 12:51:47.060064+0530 MyApp[11781:227383] Task <91287390-CC8A-4F32-8403-929E95353B4B>.<1> finished with error - code: -1200 2017-10-10 12:52:39.286401+0530 MyApp[11781:228768] TIC Read Status [5:0x0]: 1:57 2017-10-10 12:52:39.286849+0530 MyApp[11781:228768] TIC Read Status [5:0x0]: 1:57 2017-10-10 12:52:43.375836+0530 MyApp[11781:228768] TIC Read Status [6:0x604000366540]: 1:57 2017-10-10 12:52:43.376470+0530 MyApp[11781:228768] TIC Read Status [6:0x604000366540]: 1:57 2017-10-10 12:52:43.377415+0530 MyApp[11781:228768] TIC Read Status [6:0x604000366540]: 1:57 2017-10-10 12:54:38.998920+0530 MyApp[11781:230845] TIC Read Status [2:0x600000361440]: 1:57 2017-10-10 12:54:38.999998+0530 MyApp[11781:230845] TIC Read Status [2:0x600000361440]: 1:57 2017-10-10 12:54:39.000339+0530 MyApp[11781:230845] TIC Read Status [2:0x600000361440]: 1:57 2017-10-10 13:09:16.756803+0530 MyApp[11781:246165] [Client] Discarding message for event 0 because of too many unprocessed messages
[REQUIRED] Step 2: Describe your environment
- Xcode version: XCode 9
- Firebase SDK version: Firebase (4.3.0),FirebaseAnalytics (4.0.4) ,FirebaseCore (4.0.8), FirebaseInstanceID (2.0.4) ,FirebaseMessaging (2.0.4)
Hmm, this looks like it was a temporary SSL issue. Is this happening all the time? If so, what location are you in? And do you have any restrictions on your network?
I'm getting this issue too..
Same error here, but different evironment:
- Xcode Version: XCode 9
- Firebase SDK version: FirebaseCore (4.0.11), FirebasePerformance (1.0.6), FirebaseAnalytics (4.0.5)
All firebase SDK were installed through CocoaPods: Firebase/Core (4.6.0) Firebase/Performance (4.6.0)
For those running into this issue, can you answer the questions rsattar posted above as well? Also, please post your error messages and make sure they don't differ from the original post.
I'm also getting this error also except it failed on resolving play.googleapis.com:
- Xcode Version: Xcode 9.1
- Firebase/Core (4.7.0) - FirebaseCore (4.0.12), FirebaseAnalytics (4.0.5), FirebaseMessaging (2.0.7)
- Firebase/Messaging (4.7.0) - FirebaseMessaging (2.0.7)
All firebase SDK were installed through CocoaPods:
pod 'Firebase/Core'
pod 'Firebase/Messaging'
For rsattar's questions:
- I'm in Idaho, USA
- No restrictions on network
- I've tried while connected to wifi with my local provider and through T-Mobile network
I switched name servers to use 8.8.8.8 and everything was working fine. Oddly, switching back to using my ISPs DNS servers still worked after it worked with the previous test.
My ISPs resolved play.googleapis.com to:
$ nslookup play.googleapis.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Non-authoritative answer:
play.googleapis.com canonical name = googleapis.l.google.com.
Name: googleapis.l.google.com
Address: 216.58.216.138
Name: googleapis.l.google.com
Address: 172.217.3.170
Name: googleapis.l.google.com
Address: 216.58.193.74
Name: googleapis.l.google.com
Address: 172.217.3.202
Name: googleapis.l.google.com
Address: 216.58.216.170
I am located in Lithuania and getting same error fro this request:
let query = ref.child("email").queryOrderedByKey().queryEqual(toValue: "[email protected]")//.queryEqual(toValue: "[email protected]", childKey: "email")
query.observe(.value) { (snapshot) in
print("\(snapshot.childrenCount)")
}
And here is an error:
2017-12-18 05:41:11.063674+0200 PL[1297:447036] [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x1d0305c40>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, NSErrorPeerCertificateChainKey=(
"<cert(0x14981fc00) s: *.googleapis.com i: Google Internet Authority G2>",
"<cert(0x14b00b200) s: Google Internet Authority G2 i: GeoTrust Global CA>",
"<cert(0x14b00ba00) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"
), NSUnderlyingError=0x1cc0448f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x1d0305c40>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x14981fc00) s: *.googleapis.com i: Google Internet Authority G2>",
"<cert(0x14b00b200) s: Google Internet Authority G2 i: GeoTrust Global CA>",
"<cert(0x14b00ba00) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"
)}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://play.googleapis.com/log, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorClientCertificateStateKey=0}, with Status Code: 0
@ramunasjurgilas looks like you were having a certificate mismatch, which is possibly an issue with your local internet.
@morganchen12 Sorry to say, but I do not agree with your comment. I tried with mobile operator & the biggest internet provider in Lithuania. And result is the same.
Does it work if you test on a different device?
Thanks for quick responses.
It is not working from different device as well.
I want to notice one more thing. If problem exists on local internet provider then connection to & from Firebase Database should not work. Correct me if I am wrong. So setValue is working fine:
let dbRef = Database.database().reference()
dbRef.child("post").child("groupName").setValue("hello world1")
When diving deeper to the logs found this error:
2017-12-18 12:44:29.948270+0200 PL[5972:462597] [BoringSSL] Function nw_protocol_boringssl_input_finished: line 1386 Peer disconnected during the middle of a handshake. Sending errSSLFatalAlert(-9802) alert
One more error:
[BoringSSL] Function boringssl_context_get_peer_sct_list: line 1754 received sct extension length is less than sct data length
And here is one more error:
2017-12-18 12:44:29.952645+0200 PL[5972:462597] TIC TCP Conn Failed [1:0x604000169540]: 3:-9802 Err(-9802)
Yeah, good point. Looks like only requests to one particular google API are failing. If you try manually setting the DNS like tspiva did, does the error go away?
I can not understand how changing Wi-Fi on my mac can solve problems on iPhone. But any way I tried and without luck. Still the same result.
Set the DNS on your phone, not your mac.
Thanks for pointing. After these changes were made it is failing only on first execution (run of the app). And afterwards, when executing queryEqual queries no errors printed to console. But even when no error printed queryEqual returns null. In reality I am expecting not nil response. Using this code from bellow:
let dbRef = Database.database().reference()
dbRef.child("post").child("groupName").setValue("hello world1")
let postRef = dbRef.child("post")
print(postRef)
let query1 = postRef.queryEqual(toValue: "hello world1", childKey: "groupName")
query1.observe(.value) { (snapshot) in
print(snapshot)
}
I had the same problem. Enabling a personal hotspot on my iPhone and connecting my mac to the tethered wifi solved the problem. Just this error persists:
...
2017-12-28 10:39:58.362877+0100 MyApp[1645:645198] [] nw_connection_get_connected_socket 32 Connection has no connected handler
2017-12-28 10:39:58.363005+0100 MyApp[1645:645198] TCP Conn 0x106f61720 Failed : error 0:61 [61]
...
That's obviously just a temporary solution though. I'll edit this post as soon as I found out what exactly was causing the problem.
Hey all,
This issue hasn't been actionable for a while, so I'm going to close it for now. If you have any new debugging information, feel free to comment on the closed issue and I'll re-open it.
If you have the same error message but think it may be a separate bug, please file a new issue and I'll take a look.
I am having the same issue.
Environment:
- Xcode Version 9.2
- Swift 4.0.3
- Firebase installed via CocoaPods
Same error here :
Xcode Version: XCode 9.2
[BoringSSL] Function nw_protocol_boringssl_input_finished: line 1386 Peer disconnected during the middle of a handshake. Sending errSSLFatalAlert(-9802) alert
2018-03-08 11:41:47.946673+0530 FirebaseCheck[31161:1161612] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
2018-03-08 11:41:47.946815+0530 FirebaseCheck[31161:1161612] Task