Subject: AGSXMPP secure communication
how to make xmpp communication secure, am only talking about the server implementation, if i make the authentication SSL, server will start the secure communication?
Should i need some certification ? or any configuration at the server end?
Should i need some certification ? or any configuration at the server end?
- private void streamParser_OnStreamStart(object sender, Node e)
- {
- SendOpenStream();
- if (!IsAuthenticated)
- {
- SendStreamFeatures(StreamFeatures.SSL);
- }
- }
- private void SendStreamFeatures(StreamFeatures choice)
- {
- switch (choice)
- {
- case StreamFeatures.SSL:
- sb.Append(
- "<stream:features><starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"><required/></starttls>\">");
- sb.Append("<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">");
- sb.Append("<mechanism>PLAIN</mechanism>");
- sb.Append("</mechanisms>");
- sb.Append("</stream:features>");
- break;
- case StreamFeatures.Sasl:
- sb.Append("<stream:features xmlns:stream=\"http://etherx.jabber.org/streams\">");
- sb.Append("<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">");
- sb.Append("<mechanism>PLAIN</mechanism>");
- sb.Append("</mechanisms>");
- sb.Append("</stream:features>");
- break;
- case StreamFeatures.Bind:
- sb.Append("<stream:features xmlns:stream=\"http://etherx.jabber.org/streams\">");
- sb.Append("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\" />");
- sb.Append("</stream:features>");
- break;
- }
- Send(sb.ToString());
- }