| Bug ID: | 57 |
| Project: | Openwsman |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Anas Nashif |
| Status: | fixed |
HTTP 1.1 requires the support for chunked transfer coding (HTTP spec section 3.6.1), however; the HTTP service in OpenWSMan does not support this when a client sends a request in chunked mode. The WBEM Solutions client sends it requests as a HTTP 1.1 chunked request, this failure in OpenWSMan prevents it from interoperating with that client.
You can see from the deamon output here that it accepts the request, including the chunk markers (see the hex digits in the payload - 200, 1f6 & 0) as XML - it then fails to parse the XML:
Dec 28 14:47:41 [306] Loading plugin: /usr/local/lib/openwsman/plugins/libwsman_test.so
Dec 28 14:47:41 [306] Loading plugin: /usr/local/lib/openwsman/plugins/libwsman_identify_plugin.so
Dec 28 14:47:41 [306] Plugin 'Test', version: 1.5.1
Dec 28 14:47:41 [306] Plugin 'IdentifyResponse', version: 1.5.1
Dec 28 14:47:41 [306] make new callback entry
Dec 28 14:47:41 [306] make new callback entry
Dec 28 14:47:41 [306] Registering 2 plugins
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/09/transfer/Get
Dec 28 14:47:41 [306] Registering endpoint for Get
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate
Dec 28 14:47:41 [306] Registering endpoint for Enumerate
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull
Dec 28 14:47:41 [306] Registering endpoint for direct Pull
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull
Dec 28 14:47:41 [306] Registering endpoint for Pull
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/09/enumeration/Release
Dec 28 14:47:41 [306] Registering endpoint for Release
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/09/transfer/Put
Dec 28 14:47:41 [306] Registering endpoint for Put
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
Dec 28 14:47:41 [306] Registering endpoint for Subscribe
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe
Dec 28 14:47:41 [306] Registering endpoint for Unsubscribe
Dec 28 14:47:41 [306] Registering Endpoint: http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
Dec 28 14:47:41 [306] Registering Endpoint: (null)
Dec 28 14:47:41 [306] Registering endpoint for Identify
Dec 28 14:47:41 [306] subscription_repository_uri = /var/lib/openwsman/subscriptions
Dec 28 14:47:41 [306] Working on port 8889
Dec 28 14:47:41 [306] Using Basic Authorization libwsman_pam_auth.so
Dec 28 14:47:48 [306] Sock 4 accepted
Dec 28 14:47:48 [306] Creating new thread. Old num_threads = 0
Dec 28 14:47:48 [306] Thread -1229939824 created
Dec 28 14:47:48 [306] shttpd thread -1229939824 started. num_threads = 1
Dec 28 14:47:48 [306] Thread -1229939824 handles sock 4
Dec 28 14:47:48 [306] do_init: initialized context 0x993d208
Dec 28 14:47:48 [306] Using Basic Authorization libwsman_pam_auth.so
Dec 28 14:47:48 [306] shttpd_add: ctx 0x993d208, sock 4, conn 0x993eb38
Dec 28 14:47:48 [306] 4 readable
Dec 28 14:47:48 [306] serve: enter 0x993eb38: local 0.0.0, remote 0.0.0
Dec 28 14:47:48 [306] serve: readremote returned 1385
Dec 28 14:47:48 [306] handle: [POST /wsman HTTP/1.1
Authorization: Basic am1hcnM6VGhpc0lzTm90TXlQV0Q=
Connection: Keep-Alive
Host: 192.168.56.128:8889
Accept-Language: *
User-Agent: WBEM Solutions WBEM Java API1.2.1 12/08/2007 15:20
Transfer-Encoding: chunked
Content-Type: application/soap+xml;charset=utf-8
Accept: text/xml, application/xml
Date: Fri, 28 Dec 2007 19:47:46 GMT
200
<?xml version="1.0" encoding="UTF-8"?>:///wsmanhttp://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumeratehttp://schemas.x
1f6
mlsoap.org/ws/2004/08/addressing/role/anonymousuuid:86c09967-075e-4be2-959f-496478600aefhttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/cim_objectmanagerinteropEnumerateObjectAndEPR
0
]
Dec 28 14:47:48 [306] Server callback started initialy. len = 4095, sent = 0
Dec 28 14:47:48 [306] Authorization: Basic am1hcnM6VGhpc0lzTm90TXlQV0Q=
Dec 28 14:47:48 [306] Connection: Keep-Alive
Dec 28 14:47:48 [306] Host: 192.168.56.128:8889
Dec 28 14:47:48 [306] Accept-Language: *
Dec 28 14:47:48 [306] User-Agent: WBEM Solutions WBEM Java API1.2.1 12/08/2007 15:20
Dec 28 14:47:48 [306] Transfer-Encoding: chunked
Dec 28 14:47:48 [306] Content-Type: application/soap+xml;charset=utf-8
Dec 28 14:47:48 [306] Accept: text/xml, application/xml
Dec 28 14:47:48 [306] Date: Fri, 28 Dec 2007 19:47:46 GMT
Dec 28 14:47:48 [306] NULL request body. len = 0
Dec 28 14:47:48 [306] Posted request: (null), wsman_msg len = 0
Dec 28 14:47:48 [306] message len = 0
Dec 28 14:47:48 [306] Response (status) 400 (No request body)
Dec 28 14:47:48 [306] serve: exit 0x993eb38: local 1.57.0, remote 0.1385.0
Dec 28 14:47:48 [306] sock 4 ready to write from 0 to 57
Dec 28 14:47:48 [306] serve: enter 0x993eb38: local 1.57.0, remote 0.1385.0
Dec 28 14:47:48 [306] writeremote: 57 57 57 0 0 0 [0: Success]
Dec 28 14:47:48 [306] serve: writeremote returned 57
Dec 28 14:47:48 [306] serve: exit 0x993eb38: local 1.0.0, remote 0.1385.0
Dec 28 14:47:48 [306] disconnecting 0x993eb38
Dec 28 14:47:48 [306] connection 0x993eb38 is keeping alive for 2 secs
Dec 28 14:47:48 [306] 4 readable
Dec 28 14:47:48 [306] serve: enter 0x993eb38: local 0.0.0, remote 0.0.0
Dec 28 14:47:48 [306] serve: readremote returned -1
Dec 28 14:47:48 [306] disconnecting 0x993eb38
Dec 28 14:47:48 [306] Thread -1229939824 processed sock 4
Dec 28 14:47:48 [306] Thread -1229939824 goes to idle state
Dec 28 14:47:52 [306] Received SIGINT... Shutting down.
Dec 28 14:47:52 [306] Shutting down daemon...
Dec 28 14:47:52 [306] shutdown_idle_cb started
Dec 28 14:47:52 [306] listener_shutdown_handler started
The easy 'fix' for this is to detect the HTTP version, if the version is 1.1 and there is no Content-Length header simply respond with a 411 error (Length Required).