Gaetano Giunta | 4 Apr 15:45 2006
Picon

one question about CAPATH / CAINFO

Hi there.
 
I got one more question about php/curl that might be possibly answered by looking at the source (or testing, but I have shortage of SSL servers around):
 
the curl options CURLOPT_CAINFO and CURLOPT_CAPATH are mutually exclusive or not? what happens when specifyng both?
 
Thanks
Gaetano Giunta
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Chris Gralike | 4 Apr 18:42 2006
Picon

Checking Sharepoint (up/down)


Kind readers,

Im trying to create a script to check based on keywords if our
"sharepoint" intranet is running, and if succesfull introduce it as a
plugin for Nagios. The only problem is that username/password is
required and sharepoint doesn't seem to allow this for some reason,
Maybe some of you can lend me a moment?

**the header**

* Connected to amisnt15.amis.nl (10.252.252.15) port 443
* error setting certificate verify locations, continuing anyway:
*   CAfile: /usr/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL connection using RC4-MD5
* Server certificate:
*        subject:
/C=NL/2.5.4.17=3439MN/ST=Utrecht/L=Nieuwegein/2.5.4.9=Edisonbaan
15/O=AMIS Services BV/OU=DIS/OU=InstantSSL/CN=my.amis.nl
*        start date: 2005-12-23 00:00:00 GMT
*        expire date: 2008-12-22 23:59:59 GMT
*        common name: my.amis.nl (matched)
*        issuer: /C=SE/O=AddTrust AB/OU=AddTrust External TTP
Network/CN=AddTrust External CA Root
* SSL certificate verify result: 20, continuing anyway.
* Server auth using Basic with user 'SECRET ;)'
> GET / HTTP/1.1
Authorization: Basic YW1pc1xjaHJpc19nOk00M3IwMQ==
Host: my.amis.nl
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

< HTTP/1.1 401 Unauthorized
< Content-Length: 1656
< Content-Type: text/html
< Server: Microsoft-IIS/6.0
< WWW-Authenticate: NTLM
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 12.0.0.3417
< Date: Tue, 04 Apr 2006 15:56:55 GMT
* Connection #0 left intact
* Closing connection #0

** The Script ** 

<?php
$args = $_SERVER['argv'];

$url = $args['1'];
$str = $args['2'];
$auth= $args['3'].":".$args['4'];

function get_site($url, $auth){
        $ch = curl_init("$url");

        //debugging//
        curl_setopt($ch, CURLOPT_VERBOSE, TRUE);

        //std funct//
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);

        //check http / https//
        if(strpos($url, "s") === 4){
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        }

        //check if authentication is required//
        if(trlen($auth) >= 1 ){
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
                curl_setopt($ch, CURLOPT_USERPWD, $auth);
        }

        $haystack = curl_exec($ch);
        curl_close($ch);
        return($haystack);
        unset($haystack);
}

/* Fetch the website */
$content = get_site($url, $auth);

echo "$content";
?>

The script is being run from the CLI with the arguments given. Example :

/usr/local/php -f curl.php https://www.somesite.com
(reserved_keyword(s)) username password

Thank you for your time.

Kind regards Chris.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Daniel Stenberg | 5 Apr 00:02 2006
Picon

Re: Checking Sharepoint (up/down)

On Tue, 4 Apr 2006, Chris Gralike wrote:

> Maybe some of you can lend me a moment?

Sure, see here:

> * Server auth using Basic with user 'SECRET ;)'

You send off your auth using Basic.

> < HTTP/1.1 401 Unauthorized

...

> < WWW-Authenticate: NTLM

The server responds and says it wants authentication done using NTLM. So, you 
need to use NTLM instead.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Daniel Stenberg | 5 Apr 09:31 2006
Picon

Re: one question about CAPATH / CAINFO

On Tue, 4 Apr 2006, Gaetano Giunta wrote:

> the curl options CURLOPT_CAINFO and CURLOPT_CAPATH are mutually exclusive or 
> not? what happens when specifyng both?

In libcurl at least they are not mutually exclusive: they can both be 
specified at the same time.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Chris Gralike | 5 Apr 16:14 2006
Picon

RE : Checking Sharepoint (up/down)

Thanks for your reply, And yes I also noticed that too. I also hoped
that setting the option : CURLOPT_HTTPAUTH, CURLAUTH_NTLM would force
cURL to use the NTLM for the authentication process (described in the
php.net documentation). And also did some research on that point.

It seems that support for this option "CURLAUTH_NTLM" has been added in
a newer php version. The exact version isn't quite clear, for
documentation says it to be 5.x and readers claim it to be 4.4.3, And my
best guess would be that this option will be silently ignored by php
when the function isn't validated "if(CURL_SETOPT() ){ do this }".

Maybe someone knows how to check the cURL libs used by php to compile
the cURL module? I will try to figure this one out in the meanwhile to.
For my guess is that that's where the problem is.

Anyway thanks for your patience.

regard,

Chris Gralike  

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Daniel Stenberg | 5 Apr 23:14 2006
Picon

Re: RE : Checking Sharepoint (up/down)

On Wed, 5 Apr 2006, Chris Gralike wrote:

> It seems that support for this option "CURLAUTH_NTLM" has been added in a 
> newer php version.

Really? We added it in libcurl 7.10.6, released in July 2003!

> The exact version isn't quite clear

Checking the PHP CVS repo, I can see that the name CURLAUTH_NTLM has been used 
since Jan 26 2004 in the code. Not that I can figure out in which versions 
that ended up in...

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Jacob Friis Saxberg | 6 Apr 13:35 2006
Picon

Can I use curl_multi_add_handle after curl_multi_exec

I'd like to update the files that should be downloaded simultaneosly
every minute or so.
Is it possible to update the handles after curl_multi_exec?

/Jacob

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Daniel Stenberg | 6 Apr 13:53 2006
Picon

Re: Can I use curl_multi_add_handle after curl_multi_exec

On Thu, 6 Apr 2006, Jacob Friis Saxberg wrote:

> I'd like to update the files that should be downloaded simultaneosly every 
> minute or so. Is it possible to update the handles after curl_multi_exec?

In the actual libcurl it certainly is, so unless the PHP/CURL layer adds any 
restriction it should just work.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Niklas Forsberg | 6 Apr 19:34 2006
Picon

Return information sent by CURLOPT_NOPROGRESS

Hey,

Is there any way to return the information which is outputted on screen
when using CURLOPT_NOPROGRESS = FALSE to a variable?

I need that information to be inserted to a log file I have.
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Michael Wallner | 6 Apr 20:24 2006
Picon

Re: Return information sent by CURLOPT_NOPROGRESS

Niklas Forsberg wrote:

> Is there any way to return the information which is outputted on screen
> when using *CURLOPT_NOPROGRESS = FALSE to a variable?
> 
> I need that information to be inserted to a log file I have.

It does not seem that this is currently possibly, but you
might want to file a feature request (I know it won't help)
you much right now...

Regards,
--

-- 
Michael - <mike( <at> )php.net> http://dev.iworks.at/ext-http/http-functions.html.gz

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php


Gmane