cURL / Mailing Lists / curl-library / Single Mail

curl-library

Not able to connect to Windows using Negotiate Protocol

From: amit nanda <amitnan83_at_gmail.com>
Date: Tue, 20 Sep 2011 05:41:06 +0530

Hi,

I want to collect windows event logs from a Windows 2008 system via Winrm
webservice on the windows box. I have written service using LibCurl that
subscribes to the Winrm service and then i am able to fetch events from the
source using the same subscription.

I am able to fetch events correctly via Basic authentication using
CURLAUTH_BASIC flag, but i want to use Negotiate authentication protocol, so
when i use CURLAUTH_GSSNEGOTIATE flag i get an error

* About to connect() to 10.31.251.161 port 5985 (#0)
* Trying 10.31.251.161... * connected
> POST /wsman HTTP/1.1
Host: 10.31.251.161:5985
Accept: */*
Content-Type: application/soap+xml;charset=UTF-8
User-Agent: ENVISION_WINRM_E_COLLECTOR
SOAPAction:"10.31.251.161:5985/wsman"
Content-Length: 1055
Expect: 100-continue

< HTTP/1.1 401
< Server: Microsoft-HTTPAPI/2.0
< WWW-Authenticate: Negotiate
< WWW-Authenticate: Kerberos
< WWW-Authenticate: Basic realm="WSMAN"
< WWW-Authenticate: CredSSP
< Date: Mon, 19 Sep 2011 12:34:10 GMT
< Connection: close
< Content-Length: 0
<
* Closing connection #0
* Issue another request to this URL: 'http://10.31.251.161:5985/wsman'
* About to connect() to 10.31.251.161 port 5985 (#0)
* Trying 10.31.251.161... * connected
* Server auth using GSS-Negotiate with user 'Administrator'
> POST /wsman HTTP/1.1
Authorization: Negotiate
TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAFASgKAAAADw==
Host: 10.31.251.161:5985
Accept: */*
Content-Type: application/soap+xml;charset=UTF-8
User-Agent: ENVISION_WINRM_E_COLLECTOR
SOAPAction:"10.31.251.161:5985/wsman"
Content-Length: 1055
Expect: 100-continue

< HTTP/1.1 401
* Authentication problem. Ignoring this.
< WWW-Authenticate: Negotiate
TlRMTVNTUAACAAAAFAAUADgAAAA1gonilkruDHIyvboAAAAAAAAAAOwA7ABMAAAABgGwHQAAAA9DAE8ATABMAEUAQwBUAEkATwBOAAIAFABDAE8ATABMAEUAQwBUAEkATwBOAAEAFABNAEEATgBDAEgARQBTAFQARQBSAAQALgBjAG8AbABsAGUAYwB0AGkAbwBuAC4AZQBuAHYAaQBzAGkAbwBuAC4AYwBvAG0AAwBEAE0AQQBOAEMASABFAFMAVABFAFIALgBjAG
8AbABsAGUAYwB0AGkAbwBuAC4AZQBuAHYAaQBzAGkAbwBuAC4AYwBvAG0ABQAuAGMAbwBsAGwAZQBjAHQAaQBvAG4ALgBlAG4AdgBpAHMAaQBvAG4ALgBjAG8AbQAHAAgA2E5ibsh2zAEAAAAA
< Server: Microsoft-HTTPAPI/2.0
< Date: Mon, 19 Sep 2011 12:34:10 GMT
< Content-Length: 0
* HTTP error before end of send, stop sending
<
* Closing connection #0

Negotiate support is enabled on the server. My curl library has
GSS_Negotiate support in it.
C:\pkg\curl-7.22.0-devel-mingw32\curl-7.22.0-devel-mingw32\bin>curl.exe
--version
curl 7.22.0 (i386-pc-win32) libcurl/7.22.0 OpenSSL/0.9.8r zlib/1.2.5
libidn/1.18 libssh2/1.3.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3
pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN Largefile NTLM SSL SSPI libz

Can you point me the issue there is in this. Do i have to enable any
more flags for this or pass some special headers.
Any help is much appreciated, as i am really stuck in this.

Thanks and Regards
Amit Nanda

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-20