Docker registry 2 issue with middleware configuration

My config file is

version: 0.1
log:
    level: info
    fields:
        service: registry
        environment: staging
storage:
    cache:
        blobdescriptor: redis
    s3:
        accesskey: <key>
        secretkey: <secret>
        region: us-west-2
        bucket: container-registry-os
        encrypt: true
        secure: true
        v4auth: true
        chunksize: 5242880
        rootdirectory: /registryv2

middleware:
    storage:
      - name: cloudfront
        options:
            baseurl: "<cloudfront-value>/"
            privatekey: /certs/rsa.pem
            keypairid: <keypairid>

auth:
    token:
        realm: "<myauthservice>"
        service: "Docker registry"
        issuer: "IPTV reg auth server"
        rootcertbundle: "/certs/cert.pem"
http:
    addr: :5000
    secret: <some_value>
    debug:
        addr: :9100
    headers:
        X-Content-Type-Options: [nosniff]
redis:
    addr: 0.0.0.0:6379
    db: 0

Get panic error in journalctl logs

5788Z" level=info msg="debug server listening :9100" 
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: time="2016-09-03T01:40:06.680366372Z" level=info msg="Starting upload purge in 41m0s" environment=staging go.version=go1.6.3 instance.id=6d2
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: panic: unable to configure storage middleware (cloudfront): asn1: structure error: tags don't match (2 vs {class:0 tag:16 length:13 isCompou
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: 
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: goroutine 1 [running]:
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: panic(0xd88060, 0xc82041aea0)
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /usr/local/go/src/runtime/panic.go:481 +0x3e6
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: github.com/docker/distribution/registry/handlers.NewApp(0x7f1491492720, 0xc8203a2810, 0xc82035e580, 0x7f1491492720)
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: time="2016-09-03T01:40:06.684527272Z" level=error msg="Handler for GET /containers/11ac65d64f4d29b3713d6068310d4cb2c30d0bad7b0aa153582fa1697
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /go/src/github.com/docker/distribution/registry/handlers/app.go:150 +0x100d
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: github.com/docker/distribution/registry.NewRegistry(0x7f1491492760, 0xc8203a2810, 0xc82035e580, 0x5, 0x0, 0x0)
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /go/src/github.com/docker/distribution/registry/registry.go:86 +0x2b0
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: github.com/docker/distribution/registry.glob.func1(0x14ccdc0, 0xc8202f3ce0, 0x1, 0x1)
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /go/src/github.com/docker/distribution/registry/registry.go:55 +0x2a9
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: github.com/docker/distribution/vendor/github.com/spf13/cobra.(*Command).execute(0x14ccdc0, 0xc8202f3c90, 0x1, 0x1, 0x0, 0x0)
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /go/src/github.com/docker/distribution/vendor/github.com/spf13/cobra/command.go:495 +0x6d4
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: github.com/docker/distribution/vendor/github.com/spf13/cobra.(*Command).Execute(0x14ccf60, 0x0, 0x0)
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /go/src/github.com/docker/distribution/vendor/github.com/spf13/cobra/command.go:560 +0x180
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]: main.main()
Sep 03 01:40:06 ip-172-31-10-123 dockerd[2957]:         /go/src/github.com/docker/distribution/cmd/registry/main.go:23 +0x23

Any suggestions on How to setup cloudfront with docker registry v2