Project

General

Profile

Converse & Tigase - 405 Invalid hostname

Rubem Silva
Added over 4 years ago

Hi there.

I'm facing a problem with Converse & Tigase and right now I can't understand what really is my problem.

I'm using Tigase as XMPP server and Converse as client. I configure the bosh on nginx like this way:

server {
        listen 80 default;
        server_name  www.myhostname.com;
        root   /var/www/converse;
        index   index.html index.htm index.php;
        location / {
                root /var/www/converse;
        }
        location ~ ^/httpbind/ {
                proxy_buffering off;
                tcp_nodelay on;
                keepalive_timeout 55;
                proxy_pass http://localhost:5280;
        }
}

And I've the Converse configured this way:

converse.initialize({
            allow_otr: true,
            auto_list_rooms: false,
            auto_subscribe: false,
            bosh_service_url: 'http://chat.hostname.com/httpbind/', // Please use this connection manager only for testing purposes
            hide_muc_server: false,
            i18n: locales['en'], // Refer to ./locale/locales.js to see which locales are supported
            play_sounds: true,
            prebind: false,
            show_controlbox_by_default: true,
            roster_groups: true,
            jid: '12332423',
            sid: '12342344',
            rid: '32434232'
        });

And every time I try to login with converse I get the "405 Invalid hostname." message.

Post:

<body rid='1533606347' xmlns='http://jabber.org/protocol/httpbind' to='admin' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'>

Response:

<body type="error" from="admin" xmlns="http://jabber.org/protocol/httpbind"><error code="405" type="cancel"><not-allowed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Invalid hostname.</text></error></body>

Tigase log:

2014-09-10 06:11:49.808 [ConnectionOpenThread]  ConnectionManager$ConnectionListenerImpl.accept()  FINEST: Accept called for service: null@null
2014-09-10 06:11:49.810 [ConnectionOpenThread]  ConnectionManager.serviceStarted()  FINER: [[bosh]] Connection started: null, type: accept, Socket: nullSocket[addr=/127.0.0.1,port=38181,localport=5280], jid: null
2014-09-10 06:11:52.779 [pool-15-thread-1]  BoshConnectionManager.processSocketData()  FINER: Processing packet: body, type: null
2014-09-10 06:11:52.780 [pool-15-thread-1]  BoshConnectionManager.processSocketData()  FINEST: Processing socket data: from=null, to=null, DATA=<body to="admin" ver="1.6" xmlns:xmpp="urn:xmpp:xbosh" xmlns="http://jabber.org/protocol/httpbind" rid="1533606347" content="text/xml; charset=utf-8" wait="60" hold="1" xmpp:version="1.0" xml:lang="en"/>, SIZE=203, XMLNS=http://jabber.org/protocol/httpbind, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=null
2014-09-10 06:11:52.780 [pool-15-thread-1]  BoshConnectionManager.processSocketData()  INFO: Invalid hostname. Closing invalid connection: from=null, to=null, DATA=<body to="admin" ver="1.6" xmlns:xmpp="urn:xmpp:xbosh" xmlns="http://jabber.org/protocol/httpbind" rid="1533606347" content="text/xml; charset=utf-8" wait="60" hold="1" xmpp:version="1.0" xml:lang="en"/>, SIZE=203, XMLNS=http://jabber.org/protocol/httpbind, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=null
2014-09-10 06:11:52.781 [pool-15-thread-1]  BoshIOService.sendErrorAndStop()  FINEST:   Writing to socket:
HTTP/1.1 405 Invalid hostname.
Content-Type: text/xml; charset=utf-8
Content-Length: 269
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type
Access-Control-Max-Age: 86400
Connection: close
Server: Tigase Bosh/5.2.0-b3447/48635d0a (2014-02-12/17:29:15)

<body xmlns="http://jabber.org/protocol/httpbind" type="error" from="admin"><error type="cancel" code="405"><not-allowed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Invalid hostname.</text></error></body>
2014-09-10 06:11:52.784 [pool-15-thread-1]  ConnectionManager.serviceStopped()  FINER:  [[bosh]] Connection stopped: bosh@chat.hostname.com/127.0.0.1_5280_127.0.0.1_38181, type: accept, Socket: bosh@chat.hostname.com/127.0.0.1_5280_127.0.0.1_38181 Socket[unconnected], jid: null
2014-09-10 06:11:52.785 [pool-15-thread-1]  ClientConnectionManager.xmppStreamClosed()  FINER: Stream closed: bosh@chat.hostname.com/127.0.0.1_5280_127.0.0.1_38181
2014-09-10 06:11:52.785 [pool-15-thread-1]  BoshConnectionManager.processSocketData()  INFO: There is no session with given SID. Closing invalid connection
2014-09-10 06:11:52.786 [pool-15-thread-1]  BoshIOService.sendErrorAndStop()  FINEST:   Writing to socket:
HTTP/1.1 404 Invalid SID
Content-Type: text/xml; charset=utf-8
Content-Length: 266
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type
Access-Control-Max-Age: 86400
Connection: close
Server: Tigase Bosh/5.2.0-b3447/48635d0a (2014-02-12/17:29:15)

<body xmlns="http://jabber.org/protocol/httpbind" type="error" from="admin"><error type="cancel" code="404"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Invalid SID</text></error></body>

Can anyone tell me what is wrong with this configuration?

Kind regards,

rubsilva


Replies (1)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

You have not provided the Tigase server configuration, however, from the details you have given above it looks like you set an incorrect domain name in your client when it attempts to connect to the Tigase server. I do not know that web client, but most likely you provide 'admin' as a user name, whereas you should provide 'admin@domain' as user name. And that domain part must match what is set in Tigase's configuration as vhost.

    (1-1/1)