in reply to Problems with sending data over Socket SSL

I would strongly suggest using LWP::UserAgent. It you want to do it with raw sockets then you really need to understand the HTTP and SSL protocols in more detail than it appears you do. I would almost certainly expect that an https connection would be using POST for its data, in which case sending it using GET is not going to work.

If you have a good reason to do it at a lower level then:

use IO::Socket::SSL 'debug4'; # levels 1-4 available

Alternatively use LWP

use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; )"); # Lie + ;-) my $req = new HTTP::Request POST => 'https://wherever.com/register.cgi +'; $req->content_type('application/x-www-form-urlencoded'); $req->content('match=www&errors=0'); my $res = $ua->request($req); print $res->is_success ? $res->content : "Error: ".$res->as_string;

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: Problems with sending data over Socket SSL
by Hero Zzyzzx (Curate) on Feb 28, 2004 at 16:41 UTC

    Seeing a pattern yet, OnLooker? They posted this query to other forums and were told (by myself, several times) to use LWP::UserAgent. Kind of like a kid- don't like what dad says? Ask mom.

    This is UNDOUBTEDLY easier to do with LWP::UserAgent. After seeing some of the code you wrote, my suggestion was to start over and ditch your Socket-based stuff. LWP makes web automation that easy.

    -Any sufficiently advanced technology is
    indistinguishable from doubletalk.

    My Biz

Re: Re: Problems with sending data over Socket SSL
by Anonymous Monk on Feb 28, 2004 at 18:25 UTC

    I have written a script with LWP that registers a domain name. But based on that registrar that I'm using, I couldn't figure out how to send my personal information for registration. I could send uername, password, domain name, but not my personal information for the final registration. It's probably due to the submit button written in javascript. The only way to do it is to post it instead of getting it...

    However, I can't seem to make use of the post alone. It only works with getting the webpage, then posting the values. Otherwise, it won't work if used post alone... Is this how LWP works? Get the content then send the data? Below is the script that submits my personal information for registration.

    <input type="image" name="" src="images/btn_purchase.gif" alt="Buy now +" border="0" tabindex="16" onclick="return checkKey('success');">
    As you can see, the onclick, submits it. I'm guessing that if I use post, I won't have to worry about submitting it. It will automatically submit it. Am I correct. Thanks.
      hi. well, can you actually show us the javascript data... maybe this script is setting an addional field or does other fancy stuff before it ist posting the data to the server.
        How do I find the javascript data?
        How do I find the javascript data?