Re: fsockopen with apache auth

From: Date: Fri, 08 Sep 2000 14:21:07 +0000
Subject: Re: fsockopen with apache auth
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-15885@lists.php.net to get a copy of this message
Christian, Thanks for the input. I changed the Authentication to Authorization and made sure I didn't have more than one /r/n while I was making the request. Alas, no joy. Being as the Host header begins HTTP/1.1 does that mean I need to make a different type of request? Could the host be refusing a http1.0 "BASIC" request and want a different type? thanks, bill Cristian Draghici wrote: > 1. according to RFC1945 you should say "Authorization" and not > "Authentification". > 2. The <Host> header comes in HTTP/1.1 and you declared 1.0. > 3. you should send \r\n\r\n when you finish the request (in your example > apache never sees the authentification part cause after host you end the > headers) > > Anyway, this works for me (Apache 1.3.12 on RedHat 6.2) > ----------- > #telnet 0 80 > GET /cristi/mail.php HTTP/1.0 > Authorization: Basic Z2lnaTpSMG1hbjFhIw== > > ----------- > > in your example I would do: > ------ > [..] > fputs($fp,"GET $path HTTP/1.0\r\nAuthorization: Basic > ".base64_encode("username:userpw")."\r\n\r\n"); > [..] > ------ > > hope this helps > cristi > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#15885) next »