The error is in the TLS|SSL negotiation between your machine and the service. It could be your machine, an intermediary or Google.
Are you behind a proxy? If there's a proxy, it may be intercepting the call.
Can you do anything else with gcloud perhaps gcloud functions list? If you can issue other commands particularly against Cloud Functions, this adds to the suspicion that it's Google's problem. If you can't, then it's more likely to be your client (and|or proxy) that are in error
If you append --log-http to the deployment (or any gcloud) command you will receive more detailed logging and this may identify the error.
Update (Python)
I tried to repro the error by creating a new project without enabling billing. I used the hello-world sample (link) and was able to deploy and test without issue. I suspect the problem was either an intermittent issue with the server (or perhaps the region). Or, more probably, an issue with the configuration on your machine.
def hello_world(request):
return "Hello World"
and requirements.txt:
flask==1.1.1
Then:
PROJECT=[[YOUR-PROJECT-ID]]
REGION=us-east1
gcloud projects create ${PROJECT}
gcloud services enable cloudfunctions.googleapis.com \
--project=${PROJECT}
gcloud functions deploy hello_world \
--region=${REGION} \
--project=${PROJECT} \
--entry-point=hello_world \
--runtime=python37 \
--source=${PWD} \
--trigger-http
After deploying successfully, I can:
URL=$(\
gcloud functions describe hello_world \
--region=${REGION} \
--project=${PROJECT} \
--format="value(httpsTrigger.url)")
curl \
--silent \
--request GET \
"${URL}"
Hello World
Update (Node.JS)
Sorry about that ;-)
exports.helloWorld = (req, res) => {
res.status(200).send("Hello World");
};
package.json:
{
"name": "hello-world",
"version": "0.0.1",
"dependencies": {}
}
And:
gcloud functions deploy hello_world \
--region=${REGION} \
--project=${PROJECT} \
--entry-point=helloWorld \
--runtime=nodejs10 \
--source=${PWD} \
--trigger-http
Otherwise as before w/ Python.
Works.
brew list | xargs brew reinstall