polly.us-east-2.amazonaws.com/v1/speech returns 200 on ubuntu 18 but forbidden 403 on ubuntu 16 server

147 Views Asked by At

AWS polly polly.us-east-2.amazonaws.com/v1/speech does not work on ubuntu 16 server and returns 403 forbidden but it works on 18 ubuntu and returns 200 OK. I am facing this issue and wired to understand the reason behind it.

What can be reason behind it ? And how to solve this issue ?

1

There are 1 best solutions below

0
On

Dear guys, Finally I got the actual reason behind it. I checked today and found it was due to the next date set 15 MAY, 15:10:00" at this Ubuntu 16 server. When I changed to today's date time and tested it. The api was fired with 200,OK.

Actually current date time is used in calculating AWS Signature 4 Code so it could not be matched with AWS server side in a particular region.

Below are the logs::

root@abc:/usr/local/vvv/Demo_Project# date Sat May 15 15:07:09 IST 2021 root@abc:/usr/local/vvv/Demo_Project# java -jar AWSTTS.jar AWS jsonString Format :: 2021-05-15 15:07:17.482 2021-05-15 15:07:18.981 AWS ResponseCode & ResponseMessage :: 403 Forbidden 3. 2021-05-15 15:07:19.229 root@abc:/usr/local/vvv/Demo_Project# date -s "14 MAY 2021 15:07:00" Fri May 14 15:07:00 IST 2021 root@abc:/usr/local/vvv/Demo_Project# java -jar AWSTTS.jar AWS jsonString Format :: 2021-05-14 15:07:04.650 2021-05-14 15:07:04.653 AWS ResponseCode & ResponseMessage :: 200 OK 3. 2021-05-14 15:07:06.295