全新安装 Ubuntu 11.10 后,Pidgin 停止连接到任何 Jabber 服务(Google Talk 和本地 IM)。奇怪的是,相同的配置在装有 Ubuntu 11.10 的笔记本电脑上可以运行,但在工作站上却不行。目录.purple
已从笔记本电脑复制到工作站,但仍然不起作用。运行时piding -d > pidgin.log
,观察到以下情况:
(16:06:25) account: Connecting to account [email protected]/.
(16:06:25) connection: Connecting. gc = 0x7f38e3828ea0
(16:06:25) dnssrv: querying SRV record for gmail.com: _xmpp-client._tcp.gmail.com
(16:06:25) dnssrv: found 5 SRV entries
(16:06:25) dnsquery: Performing DNS lookup for xmpp.l.google.com
(16:06:25) dns: Wait for DNS child 11596 failed: No child processes
(16:06:25) dns: Created new DNS child 11867, there are now 1 children.
(16:06:25) dns: Successfully sent DNS request to child 11867
(16:06:25) dns: Got response for 'xmpp.l.google.com'
(16:06:25) dnsquery: IP resolved for xmpp.l.google.com
(16:06:25) proxy: Attempting connection to 173.194.70.125
(16:06:25) proxy: Connecting to xmpp.l.google.com:5222 with no proxy
(16:06:25) proxy: Connection in progress
(16:06:25) proxy: Connecting to xmpp.l.google.com:5222.
(16:06:25) proxy: Connected to xmpp.l.google.com:5222.
(16:06:25) jabber: Sending ([email protected]): <?xml version='1.0' ?>
(16:06:25) jabber: Sending ([email protected]): <stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
(16:06:25) jabber: Recv (379): <stream:stream from="gmail.com" id="49198E875F30F7D0" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>X-OAUTH2</mechanism></mechanisms></stream:features>
(16:06:25) jabber: Sending ([email protected]): <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
(16:06:25) jabber: Recv (50): <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
(16:06:25) nss: subject=CN=gmail.com,O=Google Inc.,L=Mountain View,ST=California,C=US issuer=CN=Google Internet Authority,O=Google Inc,C=US
(16:06:25) nss: subject=CN=Google Internet Authority,O=Google Inc,C=US issuer=OU=Equifax Secure Certificate Authority,O=Equifax,C=US
(16:06:25) nss: subject=OU=Equifax Secure Certificate Authority,O=Equifax,C=US issuer=OU=Equifax Secure Certificate Authority,O=Equifax,C=US
(16:06:25) certificate/x509/tls_cached: Starting verify for gmail.com
(16:06:25) certificate/x509/tls_cached: Checking for cached cert...
(16:06:25) certificate/x509/tls_cached: ...Found cached cert
(16:06:25) nss/x509: Loading certificate from /home/david/.purple/certificates/x509/tls_peers/gmail.com
(16:06:25) certificate/x509/tls_cached: Peer cert matched cached
(16:06:25) nss/x509: Exporting certificate to /home/david/.purple/certificates/x509/tls_peers/gmail.com
(16:06:25) util: Writing file /home/david/.purple/certificates/x509/tls_peers/gmail.com
(16:06:25) certificate: Successfully verified certificate for gmail.com
(16:06:25) jabber: Sending (ssl) ([email protected]): <stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
(16:06:25) jabber: Recv (ssl)(138): <stream:stream from="gmail.com" id="F6FD74872873A647" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
(16:06:25) jabber: Recv (ssl)(197): <stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>X-OAUTH2</mechanism></mechanisms></stream:features>
(16:06:25) sasl: sasl_state is -1, failing the mech and trying again
(16:06:25) connection: Connection error on 0x7f38e3828ea0 (reason: 3 description: Server does not use any supported authentication method)
(16:06:25) account: Disconnecting account [email protected]/ (0x7f38e2ca5b50)
(16:06:25) connection: Disconnecting connection 0x7f38e3828ea0
(16:06:25) jabber: Sending (ssl) ([email protected]): </stream:stream>
(16:06:25) connection: Destroying connection 0x7f38e3828ea0
如您所见,证书似乎是有效的,有问题的是:
sasl: sasl_state is -1, failing the mech and trying again
没有启用防火墙,所以肯定有其他原因。有什么想法吗?
答案1
由于某种原因,/etc/hosts
包含错误的主机名127.0.0.1
。修改后,它开始工作。希望也能帮助别人:)
答案2
在 /etc/hostname 中检查系统的主机名。然后在 /etc/hosts 文件中对其进行修改。这将解决您的问题 :-)
答案3
我在 Ubuntu 12.04 中遇到了同样的问题。当我看到前面的评论时,我检查了一下/etc/hosts
,发现它是空白的。因此,我添加了以下内容:
127.0.0.1 localhost
127.0.1.1 ubuntu
现在看起来是这样的:
root@ubuntu:/etc/apt/apt.conf.d# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu
进而
root@ubuntu:/etc/apt/apt.conf.d# /etc/init.d/networking restart
* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces...
退出 Pidgin 并再次打开。瞧,现在它运行起来非常好。希望它也能帮助其他人。
答案4
我遇到了同样的问题。原来我启用了 Google 帐户的两步验证。我只需进入我的应用程序专用密码设置(在 Google 中)并撤销对 Pidgin 的访问权限。然后我重新添加了 Pidgin 并生成了一个新的应用程序专用密码,将其输入到 Pidgin 中的 Google Talk 帐户设置中,现在一切正常。