I am trying to connect to FCM XMPP server using Openssl TLS
I have registered a project and have a Server Key and Sender ID. I follow the notes in https://firebase.google.com/docs/cloud-messaging/auth-server#authorize_an_xmpp_connection
All my codes are in C using openssl.
Following are the communications between my App Server and FCM-XMPP Server App Server to FCM-XMPP:
<stream:stream to='fcm-xmpp.googleapis.com' version='1.0' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>
from FCM-XMPP Server:
<stream:stream from="fcm-xmpp.googleapis.com" id="E1204B9D567A6A8A" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
<stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-OAUTH2</mechanism><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
App Server to FCM-XMPP:
<auth mechanism='PLAIN' xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>base 64 encoding of <null>sendID@fcm-xmpp.googleapis.com<null>serverKey</auth>
from FCM-XMPP Server:
<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
I have a App Server communicating with GCM-XMPP Server. I am running basically the same code and I get
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>