You must use triple "\n" with GET in stringToSign. See http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
> 18 сент. 2017 г., в 12:23, [email protected] <[email protected]> > написал(а): > > I’m trying to use Ceph Object Storage in CLI. > I used curl to make a request to the RGW with S3 way. > > When I use a python library, which is boto, all things work fine, but when I > tried to make same request using curl, I always got error > “SignatureDoesNotMatch” > I don’t know what goes wrong. > > Here is my script when I tried to make a request using curl > ----------------------------------------------------------- > #!/bin/bash > > resource="/my-new-bucket/" > dateValue=`date -Ru` > S3KEY="MY_KEY" > S3SECRET="MY_SECRET_KEY" > stringToSign="GET\n\n${dateValue}\n${resource}" > signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${S3SECRET} -binary > | base64` > > curl -X GET \ > -H "authorization: AWS ${S3KEY}:${signature}"\ > -H "date: ${dateValue}"\ > -H "host: 10.0.2.15:7480"\ > http://10.0.2.15:7480/my-new-bucket <http://10.0.2.15:7480/my-new-bucket> > --verbose > > ------------------------------------------------------------ > > The result > ------------------------------------------------------------ > <?xml version="1.0" > encoding="UTF-8"?><Error><Code>SignatureDoesNotMatch</Code><RequestId>tx000000000000000000019-0059bf7de0-5e25-default</RequestId><HostId>5e25-default-default</HostId></Error> > ------------------------------------------------------------ > > Ceph log in /var/log/ceph/ceph-client.rgw.node0.log is > ------------------------------------------------------------ > 2017-09-18 16:51:50.922935 7fc996fa5700 1 ====== starting new request > req=0x7fc996f9f7e0 ===== > 2017-09-18 16:51:50.923135 7fc996fa5700 1 ====== req done req=0x7fc996f9f7e0 > op status=0 http_status=403 ====== > 2017-09-18 16:51:50.923156 7fc996fa5700 1 civetweb: 0x7fc9cc00d0c0: > 10.0.2.15 - - [18/Sep/2017:16:51:50 +0900] "GET /my-new-bucket HTTP/1.1" 403 > 0 - curl/7.47.0 > ------------------------------------------------------------ > > Many Thanks > -Juno > _______________________________________________ > ceph-users mailing list > [email protected] <mailto:[email protected]> > http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com > <http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com> -- Dmitry Glushenok Jet Infosystems
_______________________________________________ ceph-users mailing list [email protected] http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
