yes i understand now that i have to calc the signature, i was just confused by the output response when i debug
but still i need help with construcating, coz even the output for signature is not good and the system supports HMAC-SHA1. but the output is not good. just need some help
#!/usr/bin/perl -w use HTTP::Tiny; use POSIX qw(strftime); use Encode; use Digest::SHA qw(hmac_sha1); my $ua = HTTP::Tiny->new; $timestamp = strftime '%Y-%m-%dT%H:%M:%S', gmtime(); $ip = $ENV{'REMOTE_ADDR'}; $Nonce = int(rand(1000000)); $from = "sfsdfdf"; $message = "asdasd"; $to = "345345435"; my $url = "https://sms-intl.ap-southeast-1.aliyuncs.com"; my $data = { AccessKeyId => "Tgfdgdfgdfg", Action => "SendMessageToGlobe", Format => "JSON", From => $from, Message => $message, RegionId => "default", SecureTransport => "true", SignatureMethod => "HMAC-SHA1", SignatureNonce => $Nonce, SignatureVersion => "1.0", SourceIp => $ip, Timestamp => $timestamp, To => $to, Version => "2018-05-01", Signature => $signature, }; print "Content-type: text/html\n\n"; my $params = $ua->www_form_urlencode( $data ); printf "params = %s\n", $params; my $encode_message = encode('utf8',$Nonce.$params); my $signature = hmac_sha1 ($encode_message); printf "sig = %s\n",$signature;
In reply to Re^2: signature problem
by bigup401
in thread signature problem
by bigup401
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |