gloox 链接openfire服务器问题解决办法

今天心情不错,终于解决了链接服务器失败的原因。

SASL authentication failed 和Device or resource busy这两个问题整整困惑了我很长很长时间 今天终于解决了。

其实这两个问题的原因就是在于服务器认证失败的原因,我用Empathy链接服务器的时候会出现证书不一致的问题,它是可以处理证书不一致的问题的。我的服务器名为localhost.domin,而认证的时候用的只是它的IP地址。从而导致证书不一致。

从而修改服务器名就能解决这个问题:

Openfire更服务器名称的方法:
1.登陆openfire管理页面,在主页面下方选择编辑属性,修改服务器名称为当前主机名称,点击保存属性,按页面提示重启服务器。
2. 重启后,主页的服务器属性下的服务器名称出现一个叹号,鼠标放上去显示Found RSA certificate that is not valid for the server domain, 这样是由于RSA认证无效造成的,需要对新的服务器进行RSA证书的配置。
3.选择【服务器设置】菜单,选择左下方的【服务器证书】,会看到两个证书,点击后面的删除按钮全部删除。删除后按系统提示重启服务器。
4.重启后,系统提示“一个或更多的证书丢失。单击这里产生自定义签名证书”。点击后,自动生成和新的服务器匹配的RSA证书。生成后,按系统提示重启。
5.重启后,再次登录,会看到主界面的服务器名称的叹号消失了,openfire正常,客户端可以正常登陆了。

修改后运行程序如下:

log: level: 0, area: 8, This is gloox 0.9.9.12, connecting...
log: level: 1, area: 32, notice: no SRV record found for 192.168.148.128, using default port.
log: level: 0, area: 32, connecting to 192.168.148.128 (192.168.148.128:5222)
log: level: 0, area: 16384, <?xml version='1.0' ?><stream:stream to='192.168.148.128' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'  xml:lang='en' version='1.0'>
log: level: 0, area: 8192, <stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='192.168.148.128' id='d1314c34' xml:lang='en' version='1.0'/>
log: level: 0, area: 8192, <stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><auth xmlns='http://jabber.org/features/iq-auth'/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
log: level: 0, area: 16384, <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
log: level: 0, area: 8192, <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
log: level: 0, area: 4, starting TLS handshake...
status: 3
issuer: CN=192.168.148.128
peer: CN=192.168.148.128
protocol: TLS1.0
mac: SHA1
cipher: AES-128-CBC
compression: NULL
log: level: 0, area: 8, connection encryption active
log: level: 0, area: 16384, <?xml version='1.0' ?><stream:stream to='192.168.148.128' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'  xml:lang='en' version='1.0'>
log: level: 0, area: 8192, <stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='192.168.148.128' id='d1314c34' xml:lang='en' version='1.0'/>
log: level: 0, area: 8192, <stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><auth xmlns='http://jabber.org/features/iq-auth'/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
log: level: 0, area: 16384, <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>
log: level: 0, area: 8192, <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cmVhbG09IjE5Mi4xNjguMTQ4LjEyOCIsbm9uY2U9IjhINnJoN2NPcytGcWFEdVVKaFJJYkRDQWRxSElvNldFZTY0MVpZYWwiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
log: level: 0, area: 4, processing SASL challenge
log: level: 0, area: 16384, <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>dXNlcm5hbWU9InVzZXIiLHJlYWxtPSIxOTIuMTY4LjE0OC4xMjgiLG5vbmNlPSI4SDZyaDdjT3MrRnFhRHVVSmhSSWJEQ0FkcUhJbzZXRWU2NDFaWWFsIixjbm9uY2U9IjZiOGI0NTY3MzI3YjIzYzY2NDNjOTg2OTY2MzM0ODczIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwLzE5Mi4xNjguMTQ4LjEyOCIscmVzcG9uc2U9OTc1Njc1MTllNmNlN2Y3YTRlMjhjNTBmMWY1ZTEwZWMsY2hhcnNldD11dGYtOA==</response>
log: level: 0, area: 8192, <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cnNwYXV0aD00OWEzZGE0YWUwNWNmY2I3NWJiZTdjYjMxNGMxOGMxOA==</success>
log: level: 0, area: 4, SASL authentication successful
log: level: 0, area: 16384, <?xml version='1.0' ?><stream:stream to='192.168.148.128' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'  xml:lang='en' version='1.0'>
log: level: 0, area: 8192, <stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='192.168.148.128' id='d1314c34' xml:lang='en' version='1.0'/>
log: level: 0, area: 8192, <stream:features><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features>
log: level: 0, area: 16384, <iq type='set' id='bind'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq>
log: level: 0, area: 8192, <iq type='result' id='bind' to='192.168.148.128/d1314c34'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>[email protected]/d1314c34</jid></bind></iq>
log: level: 0, area: 16384, <iq type='set' id='session'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
log: level: 0, area: 8192, <iq type='result' id='session' to='[email protected]/d1314c34'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
log: level: 0, area: 16384, <presence><priority>0</priority></presence>
log: level: 0, area: 16384, <iq type='get' id='uid1'><query xmlns='jabber:iq:register'/></iq>
log: level: 0, area: 8192, <iq type='result' id='uid1' to='[email protected]/d1314c34'><query xmlns='jabber:iq:register'><username>user</username><password/><email/><name/><x xmlns='jabber:x:data' type='form'><title>XMPP Client Registration</title><instructions>Please provide the following information</instructions><field var='FORM_TYPE' type='hidden'><value>jabber:iq:register</value></field><field var='username' type='text-single' label='Username'><required/><value>user</value></field><field var='name' type='text-single' label='Full name'><value/></field><field var='email' type='text-single' label='Email'><value/></field><field var='password' type='text-private' label='Password'><required/></field></x><registered/></query></iq>
the account already exists.
链接服务器成功,这破玩意真实让人淡疼!

你可能感兴趣的:(xml,Stream,session,服务器,Authentication,encryption)