libwww-SSL Post Issue

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default libwww-SSL Post Issue

    Hello Perl Mongers!

    Environment:
    libwww-perl: 5.805
    Crypt::SSLeay -- 0.51
    OS: Solaris 8
    Perl: 5.8.4

    Issue Summary:
    Issue with SSL POST operation.

    I have a script that randomly fails against devices using HTTPS
    example: I run the script 3 times aganst the same device and all works
    ok. Then the next 3 runs fail. Then the next run works.
    I receive these types of messages:
    StatusLine[500 Server closed connection without sending any data back]
    StatusLine[500 EOF]
    When the script is run on our old dev server using libwww-perl: 5.79;
    it seems to work everytime ok.
    However, it randomly fails when using libwww-perl: 5.803 or 5.805.
    Any suggestions on how to debug this?
    I would appreciate any feedback at all!
    :)


    Code:
    use LWP;
    $ua = LWP::UserAgent->new;				# create new user agent object
    $url = "$baseUrl$urlConfigFile";		# create URL for getting config ascii
    file
    
    # set up HTTP REQUEST object
    $httpReq = HTTP::Request->new(POST=>$url) ;			# init Request object
    $httpReq-> content_type('application/x-www-form-urlencoded') ;
    $httpReq->content('DownloadFormat=ascii');			# pass form variables
    $httpReq-> authorization_basic($UID, $upassw) ;		# credentials
    $strReq = $httpReq->as_string( );		# debug dump of Request object
    
    print "\nThe Request:\n$strReq\n";
    print "\n\nNow get the WSD config ascii file.\n";
    print "Submitting browser request using url [$url].\n";
    
    $httpResp = $ua->request($httpReq) ;				# launch request
    
    $statusLine = $httpResp->status_line();
    $statusCode = $httpResp->code();
    $statusMsg = $httpResp->message();
    print "HTTP Response: StatusLine[$statusLine] Code[$statusCode]
    Message[$statusMsg]\n";
    if ($httpResp->is_success) {
    print "Request OK.\n";
    }
    else {
    die "Request failed.\n";
    }
    # ok, save content to file
    open(FILEO, ">$asciiFile") || die "Error $! Could not open file
    $asciiFile.\n";
    print FILEO $httpResp->content;
    close(FILEO);
    Example run:

    <code>
    ../getwsd4.pl device-b 10.10.10.10 1900 admin admin
    Processing devName [device-b] ip addr [10.10.10.10].
    Using libwww-perl-5.803
    Output file is [/export/ieapps/local/test/device-b.asc].
    Base URL [[url]https://10.10.10.10:1900][/url]

    The Request:
    POST
    [url]https://10.10.10.10:1900/dynamic/File/Configuration/ReceivefromDevice[/url]
    Authorization: Basic ZG16c3VwcDpmaXNINHNAIWU=
    Content-Type: application/x-www-form-urlencoded

    DownloadFormat=ascii



    Now get the WSD config ascii file.
    Submitting browser request using url
    [[url]https://10.10.10.10:1900/dynamic/File/Configuration/ReceivefromDevice][/url].
    HTTP Response: StatusLine[500 EOF] Code[500] Message[EOF]
    Request failed.

    </code>

    AZSTYX Guest

  2. Similar Questions and Discussions

    1. libwww-perl 5.803 failures
      I'm building libwww-perl version 5.803 (the latest) on Solaris 10 with perl 5.8.6. libwww-perl fails two tests as below: ...... Manifying...
    2. DataGrid & Form on Same Page Post Issue
      I have a datagrid that does and edit/update/delete/cancel routine and then I have a form at the bottom of the page with an "Add" button to add a...
    3. getURL POST issue
      when you use get URL, use it like this getURL("http://my.sssss.com/mycgi.cgi?Name= dsafdsfsd","_blank"); don't write post or get. Just omit...
    4. Installing libwww-perl-5.69 on Mac OSX
      Hi, I'm trying to install libwww-perl-5.69 on my OSX machine to run under Perl 5.8.0. The build appears to have gone okay but when I run 'make...
    5. libwww-perl Problems
      Hi I am having problems using the LWP Package, for example if I run CPAN from the command line to get a new package I get the error: can't...
  3. #2

    Default Re: libwww-SSL Post Issue


    "AZSTYX" <azstyx@yahoo.com> wrote in message
    news:1154549054.646278.192020@p79g2000cwp.googlegr oups.com...
    > Hello Perl Mongers!
    >
    > Environment:
    > libwww-perl: 5.805
    > Crypt::SSLeay -- 0.51
    > OS: Solaris 8
    > Perl: 5.8.4
    >
    > Issue Summary:
    > Issue with SSL POST operation.
    >
    > I have a script that randomly fails against devices using HTTPS
    It's not clear to me at precisely which point the script is failing. Is it
    the call to new() ? or perhaps the $ua->request() ? or perhaps something
    else ?

    I think the first thing to do is to determine just where (in the script) the
    rot sets in - by examining (immediately) the return values of such things as
    the new() call.

    Cheers,
    Rob


    Sisyphus Guest

  4. #3

    Default Re: libwww-SSL Post Issue


    Sisyphus wrote:
    > "AZSTYX" <azstyx@yahoo.com> wrote in message
    > news:1154549054.646278.192020@p79g2000cwp.googlegr oups.com...
    > > Hello Perl Mongers!
    > >
    > > Environment:
    > > libwww-perl: 5.805
    > > Crypt::SSLeay -- 0.51
    > > OS: Solaris 8
    > > Perl: 5.8.4
    > >
    > > Issue Summary:
    > > Issue with SSL POST operation.
    > >
    > > I have a script that randomly fails against devices using HTTPS
    >
    > It's not clear to me at precisely which point the script is failing. Is it
    > the call to new() ? or perhaps the $ua->request() ? or perhaps something
    > else ?
    >
    new() is a constructor....it has no return value; the first item with a
    return status is the ->request which returns code 500.
    > I think the first thing to do is to determine just where (in the script) the
    > rot sets in - by examining (immediately) the return values of such things as
    > the new() call.
    >
    > Cheers,
    > Rob
    AZSTYX Guest

  5. #4

    Default Re: libwww-SSL Post Issue

    > new() is a constructor....it has no return value; the first item with a
    > return status is the ->request which returns code 500.
    >> I think the first thing to do is to determine just where (in the script) the
    >> rot sets in - by examining (immediately) the return values of such things as
    >> the new() call.
    >>
    >> Cheers,
    >> Rob
    >
    not true... new returns $ua, isn'it?
    a reference to your user agent

    use LWP's debug mode
    hth
    --stephan
    Stephan Titard Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139