10

Can I use HTTPS client certificate authentication with HTTPS-triggered Google Cloud Functions?

I stand-alone node.js, I would try something like this:

var https = require('https'); 
var options = {requestCert: true, rejectUnauthorized: true}; 
https.createServer(options, function (req, res) { 
  // ...
}).listen(1234);

But since Google Cloud Functions (presumably) controls the creation of the node.js server, it is currently unclear to me how I could pass the required options.

Google offers documentation on how to use (OAuth 2.0) service accounts and access tokens for authentication, but I am interested in HTTPS client certificates, such as a web browser could also present.

Peter W
  • 952
  • 8
  • 18
Drux
  • 11,992
  • 13
  • 66
  • 116
  • There's nothing to indicate this is possible on Google's Cloud Function documentation page for the execution environment: https://cloud.google.com/functions/docs/concepts/exec This might be helpful for confirming: "Cloud Functions uses a Debian-based execution environment and includes contents of the gcr.io/google-appengine/nodejs Docker image. To see what is included in the image, you can check its GitHub project, or pull and inspect the image itself": https://github.com/GoogleCloudPlatform/nodejs-docker – Peter W May 08 '18 at 00:45
  • Have you found anything ? I need to do this as well – Geoffrey H Sep 14 '18 at 17:06
  • @GeoffreyHug Nops, havn't found any solution to this. – Drux Sep 15 '18 at 08:08
  • 1
    @Drux I found this https://github.com/ripjar/passport-client-cert. I didn't have time to look into it thoroughly but I think it might do the job. – Geoffrey H Sep 15 '18 at 17:48

0 Answers0