tags:

views:

37

answers:

0

Hi,

My perl code is as follows

#!/usr/bin/perl

use strict;
use warnings;
use WWW::Mechanize;
use Crypt::SSLeay;

# proxy
$ENV{HTTPS_PROXY}='http://proxy:8080/';

# debugging (SSL diagnostics)
$ENV{HTTPS_DEBUG} = 1;

my $mechanize = WWW::Mechanize->new(noproxy => 0);
$mechanize->proxy(['http', 'https'], 'http://proxy:8080/');
$mechanize->get("http://www.site.com/");
$mechanize->submit_form(form_id => 'signin',fields => { login => 'user', password => 'pass'});

I get the 'Bad Request' Error

Error GETing https://www.site.com/dashboard: Bad Request at scrape.pl

The things I've tried so far,

$ENV{HTTPS_PROXY}='http://proxy:8080/';

and

noproxy => 0

Edit: when I try a https get with LWP::simple it works

neither have worked. I'm behind a proxy and ssl works through the browser. Can someone help me out?