Google App Engine + MongoDB(带有SSL证书) [英] Google App Engine + MongoDB (w/ SSL Certificate)

查看:53
本文介绍了Google App Engine + MongoDB(带有SSL证书)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正处于启动网站的最后阶段,其中包含一些数据可视化应用程序和用户身份验证功能.用户数据存储在外部服务器(我们管理的GCP实例)上的MongoDB中,并且需要SSL身份验证.我遇到的问题如下:

I'm in the final stages of launching a website complete w/ a few data visualization apps and user authentication capabilities. User data is stored in MongoDB on an external server (GCP instance that we manage), and SSL authentication is required. The problem I'm running into is the following:

为了连接到MongoDB(创建/验证/更新用户信息),需要ssl证书的路径(在MongoDB URI中带有"ssl_ca_certs"参数).在GCP实例(或本地)上,这没什么大不了的……只需键入SSL证书的绝对路径即可连接到我们,但是Google App Engine似乎没有任何可读写的本地文件系统,让我想知道是否甚至可以使用ssl_ca_certs参数.

In order to connect to MongoDB (create/authenticate/update user information) the path to the ssl certificate is required ("ssl_ca_certs" argument w/in the MongoDB URI). On a GCP instance (or locally) this is no big deal... just type in the absolute path of the SSL certificate and we're connected, however Google App Engine doesn't appear to have any readable/writable local filesystem, which makes me wonder if using the ssl_ca_certs argument is even possible.

有没有人有使用SSL证书从GAE连接到MongoDB的经验?如果是这样,解决方案是什么?

Has anyone had any experience connecting to MongoDB from GAE using an SSL certificate? If so, what was the solution?

谢谢!

推荐答案

如果我正确理解,则需要使用可读/可写的文件系统来使用GAE.

If I understood correctly, you need a readable/writable file system to work with GAE.

您可以使用GCS(Google云存储)从GAE(标准{1}和Flexible {2})写入和读取文件.

You can use GCS (Google Cloud Storage) to write and read your files from GAE (Standard {1} and Flexible {2}).

也许另一个好的解决方案是在app.yaml中使用环境变量{3},{4}.

Maybe another good solution is using environment variables inside your app.yaml {3},{4}.

{1}: https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/read-write-to-cloud-storage

{2}: https://cloud.google.com/appengine/docs/flexible/python/using-cloud-storage

{3}: https://cloud.google.com/appengine/docs/standard/python/config/appref

{4}: https://cloud.google.com/appengine/docs/flexible/nodejs/runtime#environment_variables

这篇关于Google App Engine + MongoDB(带有SSL证书)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆