出现问题
500 proxy connect failed: PROXY ERROR HEADER, could be non-SSL URL
我的代码如下:
use LWP::Debug qw(+);
use HTTP::Request::Common;
use Crypt::SSLeay;
use HTTP::Headers;
use HTTP::Request;
use LWP;
$url = "https://ip:port/service";
my $ua = new LWP::UserAgent;
$ENV{HTTPS_DEBUG} = 1;
$ENV{HTTPS_PROXY} = 'https://ip:port';
$ENV{HTTPS_PROXY_USERNAME} = "username";
$ENV{HTTPS_PROXY_PASSWORD} = "password";
$ENV{HTTPS_CA_FILE} = 'cert.crt';
$ENV{HTTPS_CA_DIR} = '/passof/cert/';
$ENV{HTTPS_VERSION} = '3';
my $message = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/e
nvelope/" xmlns:aud="https://ip:port/">
<soapenv:Body>
any /////
</soapenv:Body>
</soapenv:Envelope>';
my $userAgent = LWP::UserAgent->new();
my $request = HTTP::Request->new( GET => 'https://ip:port/service' );
$request->header( SOAPAction => '"https://ip:port/action"' );
$request->content($message);
$request->content_type("text/xml; charset=utf-8");
my $response = $userAgent->request($request);
if ( $response->code == 200 ) {
print $response->as_string;
}