setting up signed cookies for aws cloudfront https with php SDK

Viewed 1450

I am setting up a HLS streaming service through cloudfront and implementing several security measures for content protection. I have successfully made it work under http, I can stream video and watch it in my website with a lot of content protection security measures. For more details on how I managed to make it work for http you can consult it in a post I made in drupal.org about secure hls streaming.

But now I need to add https to the formula because some encryption keys for hls encrypted segments are being transmitted, but I am having problems. Now I am working to add https to the formula. I have added a certificate to my site and I have added a different certificate in cludfront because my certificate is not a wildcard one.

My site certificate works for subdomain.mydomain.com

My cloudfront certificate is for *.mydomain.com

My cloudfront distribution has a cname of cdn.mydomain.com

When I create the cookie I set the secure parameter to true in the call (6th parameter after domain):

setcookie($name, $value, strtotime('+1 hour'), "/", ".mydomain.com", true, true);

But when I try to access some test data in my site

if (readfile('https://cdn.mydomain.com/privacy_test.txt')==0)
    print "Error in cdn access";

I don't see the contents of the file in my website, but the error message.

So it seems I need more things to do to make cloudfront aws signed cookies work under https. Any help?

1 Answers
Related