【发布时间】:2020-04-21 12:07:17
【问题描述】:
禁用 TLS 后,我可以使用与此处所示相同的代码通过我的 lambda 函数成功连接 - https://docs.aws.amazon.com/documentdb/latest/developerguide/connect.html#w139aac29c11c13b5b7
但是,当我启用 TLS 并使用上述链接中启用 TLS 的代码示例时,我的 lambda 函数会超时。我已经通过 wget 下载了 rds 组合的 ca pem 文件,并且我正在将 pem 文件连同我的代码一起部署到 AWS lambda。
这是我的执行停止和超时的代码:
caFilePath = "rds-combined-ca-bundle.pem"
var connectionStringTemplate = "mongodb://%s:%s@%s:27017/dbname?ssl=true&sslcertificateauthorityfile=%s"
var connectionURI = fmt.Sprintf(connectionStringTemplate, secret["username"], secret["password"], secret["host"], caFilePath)
fmt.Println("Connection String", connectionURI)
client, err := mongo.NewClient(options.Client().ApplyURI(connectionURI))
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
打印“连接字符串”后,我在 cloudwatch 日志中没有看到任何错误。
【问题讨论】:
标签: amazon-web-services go ssl aws-documentdb-mongoapi