Forum Moderators: coopster

Message Too Old, No Replies

ssl authenticated access WITHOUT curl

fsockopen https login possible?

         

amznVibe

7:10 pm on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's straightforward to make a general ssl/https connection using fsockopen.
But can logins (authenticated access) be done?
If so, mini-examples please? Or pointers to resources...

Thanks!

demnetia

8:14 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



Do you mean Basic HTTP authentication?
If so, you can slap an Authorization header in the request headers.

$header = "Authorization: Basic " . base64_encode(sprintf('%s:%s', $username, $password)) . "\r\n";

This is the simplest HTTP authentication. Of course there are other more complex ones that require a lot more code.

amznVibe

10:57 pm on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wouldn't that be unencrypted if it's passed in the header?
Or is once the socket created, all data including headers are not in the clear?