cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

NTLM auth error

From: Doug Dalton <ddalton_at_shortbus.net>
Date: Sat, 20 Dec 2008 22:56:31 -0800
I am having a problem with NTLM auth with 7.15.5 on centos 5.2 getting the error  :

gss_init_sec_context() failed: : Unknown code krb5 195* Authentication problem. Ignoring this. 

Does this mean a bad password?  (I am using a known good password)

Version
curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

using php:
PHP 5.1.6 (cli) (built: Jul 16 2008 19:52:52)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


        $header=Array();
        $cookiefile = tempnam("/tmp", "TMPCOOKIE");
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Server Agent');
        curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); 
        curl_setopt($ch, CURLOPT_HTTPAUTH,CURLAUTH_ANY);

            $header[]="Depth: 0";
            $header[]= "Translate: f";
            $header[]= "Content-Type: text/xml";
          
        curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $query);

        curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookiefile);
        curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookiefile);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_VERBOSE, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        $result=curl_exec ($ch);
        $responsecode = curl_getinfo($ch, CURLINFO_HTTP_CODE);



Debugging:
  1. * About to connect() to webmail.x.com port 443
  2. *   Trying x.x.x.x... * connected
  3. * Connected to webmail.x.com (x.x.x.x) port 443
  4. * successfully set certificate verify locations:
  5. *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  6.   CApath: none
  7. * SSL connection using RC4-MD5
  8. * Server certificate:
  9. *        subject: /O=webmail.x.com/OU=Domain Control Validated/CN=webmail.x.com
  10. *        start date: 2007-11-28 15:29:10 GMT
  11. *        expire date: 2009-11-28 15:29:10 GMT
  12. *        issuer: /C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure Certification Authority/serialNumber=07969287
  13. * SSL certificate verify ok.
  14. > OPTIONS /exchange/ HTTP/1.1
  15. User-Agent: Branchit Server Agent
  16. Accept: */*
  17. Depth: 1
  18. Translate: f
  19. Content-Type: text/xml
  20.  
  21. < HTTP/1.1 401 Unauthorized
  22. < Date: Tue, 09 Dec 2008 19:31:13 GMT
  23. < Content-Length: 83
  24. < Content-Type: text/html
  25. < Server: Microsoft-IIS/6.0
  26. < WWW-Authenticate: Negotiate
  27. < WWW-Authenticate: NTLM
  28. < WWW-Authenticate: Basic realm="webmail.x.com"
  29. < X-Powered-By: ASP.NET
  30. * Ignoring the response-body
  31. * Connection #0 to host webmail.x.com left intact
  32. * Issue another request to this URL: 'https://webmail.x.com/exchange/'
  33. * Re-using existing connection! (#0) with host webmail.x.com
  34. * Connected to webmail.x.com (x.x.x.x) port 443
  35. > OPTIONS /exchange/ HTTP/1.1
  36. User-Agent: Server Agent
  37. Accept: */*
  38. Depth: 1
  39. Translate: f
  40. Content-Type: text/xml
  41.  
  42. < HTTP/1.1 401 Unauthorized
  43. < Date: Tue, 09 Dec 2008 19:31:14 GMT
  44. < Content-Length: 83
  45. < Content-Type: text/html
  46. < Server: Microsoft-IIS/6.0
  47. * gss_init_sec_context() failed: : Unknown code krb5 195* Authentication problem. Ignoring this.
  48. < WWW-Authenticate: Negotiate
  49. < WWW-Authenticate: NTLM
  50. < WWW-Authenticate: Basic realm="webmail.x.com"
  51. < X-Powered-By: ASP.NET
  52. * Connection #0 to host webmail.x.com left intact
  53. * Closing connection #0

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-12-21