作者:
InterMa 来源:
博客园 发布时间:2006-12-07 01:18 阅读:1436 次
原文链接
[收藏]
最近闲着没事,想用python写一个CUI的XMPP客户端,Server就用google的talk.google.com了,在google的Open Communications 上获得以下信息: The service is hosted at talk.google.com on port 5222 TLS is required The only supported authentication mechanism is SASL PLAIN 但是经过测试,dump了一下XMPP Stream,发觉实际的情况没这么简单,dump的具体过程就不废话了(用gaim来dump,:-)),得出的具体结论如下: 【1】talk.google.com:5222: 这个地址应该主要是给gtalk用的,因为首先这个地址不支持SASL:PLAIN认证,只支持google自己的X-GOOGLE-TOKEN认证(关于X-GOOGLE-TOKEN认证,详见 这里 )。其次就是无法以SSL(TLS)方式连接(错误提示:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol,这里已经搞清楚了因为python没有内置StartTLS功能的模块 ,:-<)。因此不支持TLS handshake(StartTLS) 的第3方客户端建议不要连这个地址。 【2】talk.google.com:5223: 和上个地址正好相反,这个地址只支持以SSL(TLS)方式进行连接。以SSL(TLS)方式连接之后,发现它支持SASL:PLAIN和X-GOOGLE-TOKEN认证,因此我们自己写的第3方客户端连这个地址就可以了。 2006年12月7日重要更新: 今天在psi-im的wiki 上获得了一个重要信息: In the Jabber world, these two terms are used as following:
- SSL support: communication using SSL or TLS protocol, on port 5223 , without handshaking - the stream is encrypted from the very beginning.
- TLS support: communication using SSL or TLS protocol, on port 5222 , with handshaking (also known as StartTLS ) - the encryption type is first negotiated in plain text and afterwards the stream is encrypted.
这下就没什么可说得了,上边说得很清楚了。 5222口在TLS handshake之后,就支持PLAIN验证了(感谢linux@bmy ,同时打算和他搬到这里 ,用C开发了),错怪google了,:-) 此文只保证现状如此(同时本人分析过程仅供参考),不保证一定正确且对未来的变化没有任何担保,:-P 谈google talk的加密问题 |