use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Headers;
use HTTP::Response;
use Encode;
use File::Temp qw/tempfile/;
my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, );;
$ua->timeout(10);
$ua->env_proxy;
my $now = time();
$ua->agent("Mozilla/8.0");
my $cookie_jar = HTTP::Cookies->new( file => 'lwp_cookies.txt',
autosave => 1,
ignore_discard => 1
);
$ua->cookie_jar($cookie_jar);
my $str=(rand(1));
#system ("del/f/s/q c:\wj_qrcod*.jpg");
my $response = $ua->get("https://www.zjtest2.com/validcode/generate-validcode.do?$str"); print "\$str is $str\n";
if ($response->is_success) {
$r = $response->decoded_content;
# print $response->decoded_content; # or whatever
}
else {
print $response->decoded_content;
die $response->status_line;
}; my ( $fh, $filename ) =
tempfile( "wj_qrcode_XXXX", SUFFIX => ".jpg", DIR => 'c:\\' );
binmode $fh;
print $fh $r;
close $fh;
print "登录二维码已经下载到本地 [ $filename ] \n"; ##打开图片
system("start $filename "); my $validCode = <STDIN>;
chomp $validCode ;
print "\$validCode is $validCode\n"; #my $url="https://www.zjtest2.com/business/dispatch_post.do"; my $login_url = 'https://www.zjtest2.com/business/dispatch_post.do'; my $res = $ua->post($login_url,{
'action'=>'doLogin',
'userName'=>'kevin',
'followId'=>'',
'userPass'=>'3d24b838770ee90773804e8599e549ff',
'validCode'=> "$validCode"
});
print "---------------\n"; my $head =$res->header('Location');
print $res->header('Location');
print "\n"; print $res->status_line."\n";
print $res->as_string();#获取的是原始内容,包括响应头,响应正文 my $content=$res->content();
print $res->content(); #获取的是响应正文 my $spool = encode("gbk",decode("utf8","$content"));
print "\$spool is $spool\n";
print "\n"; my $response = $ua->get("$head");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; my $url="https://www.zjtest2.com/business/dispatch_get.do?action=doDeposit";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; while(1==1){ ##转入2级市场现金现金
##https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=1&tradePassword=79e8fe923f031f46221a9283d0c9263a&_=1460426257542
##1460426541
my $now = time();
my $url="https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=$now";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; ###转出到1级市场现金
##https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=1460441529452
###https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fout&amount=2&tradePassword=79e8fe923f031f46221a9283d0c9263a&_=$now my $url="https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fout&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=$now";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; };

perl lwp关闭ssl校验的更多相关文章

  1. haproxy 关闭ssl 3.0 加密

    global log 127.0.0.1 local3 maxconn 65535 chroot /usr/local/haproxy uid 500 gid 500 daemon ssl-defau ...

  2. 关闭SSL证书验证

    转载 Python3之关闭SSL证书验证 转载 Python requests 移除SSL认证,控制台输出InsecureRequestWarning取消方法 报错信息: Traceback (mos ...

  3. vue项目关闭eslint校验

    [前言] eslint是一个JavaScript的校验插件,通常用来校验语法或代码的书写风格.这篇文章主要介绍了vue项目关闭eslint校验,需要的朋友可以参考下 [主体] 简介eslint esl ...

  4. 用vue ui创建的项目怎么关闭eslint校验

    在Vue Cli的控制面板找到配置-ESLint configuration,然后关闭保存时检查就可以了

  5. perl lwp 超时问题

    lwp 超时问题: jrhmpt01:/root/async# cat a1.pl use LWP::UserAgent; use utf8; use DBI; use POSIX; use Data ...

  6. perl lwp 默认的请求头

    </pre><pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl ...

  7. perl lwp 获取请求头

    <pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl use LWP::Us ...

  8. perl LWP::UserAgent获取源码与响应

    #!/usr/bin/perl -w use strict; use LWP::UserAgent; my $useragent = new LWP::UserAgent; my $url = 'ht ...

  9. 关闭SSL服务[iRedMail]

    相信有很多朋友接触并使用地iRedMail这个软件了, 其强大的邮件收发功能, 垃圾及病毒检索能力自不用说了. 其自身携带的dovecot组件提供的SSL也足以使人们对这个软件侧目, 但是正是由于这个 ...

随机推荐

  1. jQuery Mobile基础

    1.安装 在<head></head>标签里边写入以下内容 jQuery Mobile CDN: <head> <meta charset="utf ...

  2. ToDoList-学习中看到的知识盲点

    1. java中的volatile关键字的作用 2. java类加载器 3. Android源码编译 4. MediaPlayer的用法 5. Html5和web app

  3. Linux学习之挂载

    linux的系统组织方式是——整个系统从根开始,按树形目录依次向下逐渐扩大,分类存放不同用途的文件,/读作“斜线”,英文slash:当其写作一个路径时,第一个/表示根,即root,其他的/表示路径分割 ...

  4. 搭建Hadoop集群 (三)

    通过 搭建Hadoop集群 (二), 我们已经可以顺利运行自带的wordcount程序. 下面学习如何创建自己的Java应用, 放到Hadoop集群上运行, 并且可以通过debug来调试. 有多少种D ...

  5. [ 转 ]jquery的ajax和getJson跨域获取json数据

    目前浏览器端跨域访问常用的两种方法有两种: 1.通过jQuery的ajax进行跨域,这其实是采用的jsonp的方式来实现的. jsonp是英文json with padding的缩写.它允许在服务器端 ...

  6. nodejs:注册登录session出错以及连接Mongodb数据库时Error connecting to database解决方案

    (1)nodejs:注册登录session出错 解决办法: 在app.js 中将var MongoStore =  require(connect-mongo')改为var MongoStore =  ...

  7. 关于gradle /Users/xxxx/Documents/workspace/fontmanager/.gradle/2.2.1/taskArtifacts/cache.properties (No such file or directory)报错办法

    转自:http://www.cnblogs.com/raomengyang/p/4367620.html   Android Studio报错: What went wrong: java.io.Fi ...

  8. ;(function( $, window, undefined ){ }(jQuery,window))为何需要往里面传$,window,undefined这些参数

    (function( $, jQuery , undefined ) {})(jQuery); 为什么要将window和undefined作为参数传给它? 因为 ecmascript 执行JS代码是从 ...

  9. less 工具

    less 工具也是对文件或其它输出进行分页显示的工具,应该说是linux正统查看文件内容的工具,功能极其强大.less 的用法比起 more 更加的有弹性.在 more 的时候,我们并没有办法向前面翻 ...

  10. Python中初始化的问题以及注释问题

    #coding=utf-8 # __author__ = 'minmin' from Tkinter import * #创建一个基于Frame的Application类 class Applicat ...