correctly set the content type header; raise not found if the cert is not found