TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
182 stars 49 forks source link

sdc-docker-setup.sh fails on CloudAPI due to incorrect request signing #83

Open janartodesk opened 8 years ago

janartodesk commented 8 years ago

CloudAPI's requests get incorrectly signed (at least) on et_EE locale due to inconsistent white space handling during calculating HTTP request signatures and setting request headers.

Input value used for calculating the signature is:

janart@toaster:~$ now=$(date -u "+%a, %d %h %Y %H:%M:%S GMT")
janart@toaster:~$ echo ${now}
N, 26 mai 2016 07:59:42 GMT

Whereas Date header on CloudAPI request gets set to (note the extra white space before year value):

janart@toaster:~$ echo "Date: ${now}"
Date: N, 26 mai   2016 07:59:42 GMT

Offending lines are: https://github.com/joyent/sdc-docker/blob/master/tools/sdc-docker-setup.sh#L147 https://github.com/joyent/sdc-docker/blob/master/tools/sdc-docker-setup.sh#L208