Project

General

Profile

Invalid Hostname error over BOSH

Troy Mestler
Added about 5 years ago

Hi,

I'm connecting to Tigase 5.2.0 over BOSH using the Strophe client library. I can connect just fine, but sometimes after a period of time, I am unable to communicate to and from the server and must refresh my browser in order to do so. I have opened up Chrome Developer tools to look at the network traffic and have found that the client is receiving 405 Invalid hostname errors when trying to post messages to the server. Here is the outgoing and incoming message verbatim:

Outgoing:

Request URL:http://server.co:5280/xmpp-httpbind/
Request Method:POST
Status Code:405 Invalid hostname.
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Content-Length:163
Content-Type:text/plain;charset=UTF-8
DNT:1
Host:server.co:5280
Origin:http://localhost:8080
Pragma:no-cache
Referer:http://localhost:8080/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
Request Payload
<body rid='2264238306' xmlns='http://jabber.org/protocol/httpbind'><iq type='get' id='1:roster' xmlns='jabber:client'><query xmlns='jabber:iq:roster'/></iq></body>
Response Headersview source
Access-Control-Allow-Headers:Content-Type
Access-Control-Allow-Methods:GET, POST, OPTIONS
Access-Control-Allow-Origin:*
Access-Control-Max-Age:86400
Connection:close
Content-Length:256
Content-Type:text/xml; charset=utf-8
Server:Tigase Bosh/5.2.0-SNAPSHOT-b3415/fbe55238 (2014-01-08/00:54:42)

Response:

<body type="error" xmlns="http://jabber.org/protocol/httpbind">
   <error type="cancel" code="405">
      <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>

We have not had this problems with OpenFire. Can you help me diagnose this problem?

Thanks!


Replies (1)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 5 years ago

Hi,

In element which is payload of a request you are missing sid attribute which is required.

From XEP-0124 at the end of section @7.1 Session Creation Request@:

??Note: All requests after the first one MUST include a valid 'sid' attribute (provided by the connection manager in the Session Creation Response). The initialization request is unique in that the element MUST NOT possess a 'sid' attribute.??

    (1-1/1)