【问题标题】:Install SSL Certificate - Google Compute Engine VM安装 SSL 证书 - Google Compute Engine 虚拟机
【发布时间】:2017-01-05 20:01:25
【问题描述】:

我正在尝试将 GoDaddy 颁发的 SSL 证书安装到我的 Google Compute Engine VM。(Debian8、Apache 服务器)

但我收到以下错误:

ERROR: (gcloud.compute.ssl-certificates.create) Some requests did not succeed:
 - Invalid value for field 'resource.name': 'SSL_CERTIFICATE'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'

我遵循的步骤是(在我的本地机器上):

mkdir ssl_cert
cd ssl_cert
openssl genrsa -out example.key 2048
openssl req -new -key example.key -out example.csr

参考链接:https://cloud.google.com/compute/docs/load-balancing/http/ssl-certificates

这 4 个命令在 ssl_cert 中创建了一个 example.csr 和 example.key 文件。 然后我去了godaddy.com并粘贴了example.csr的内容并下载了一个example.com.zip文件(对应于'Others' Server),其中包含2个.crt文件:file1.crt & file2.crt

然后我尝试了:

gcloud compute ssl-certificates create SSL_CERTIFICATE --certificate file1.crt --private-key example.key
gcloud compute ssl-certificates create SSL_CERTIFICATE --certificate file2.crt --private-key example.key

但是这两个命令都出现了同样的错误。

谁能解释一下如何正确安装它?

【问题讨论】:

  • 有什么建议吗?

标签: apache ssl debian ssl-certificate google-compute-engine


【解决方案1】:

在你的命令中

gcloud compute ssl-certificates create **SSL_CERTIFICATE** --certificate file1.crt --private-key example.key

gcloud compute ssl-certificates create **SSL_CERTIFICATE** --certificate file2.crt --private-key example.key

仅在错误消息中指定的正则表达式的帮助下,将您使用上述命令创建的证书的名称从 SSL_CERTIFICATE 更改为 somesimplename

不能使用下划线_,因为它没有在正则表达式中指定

这是一个例子:

gcloud compute ssl-certificates create sslcertificate1 --certificate file1.crt --private-key example.key
gcloud compute ssl-certificates create sslcertificate2 --certificate file2.crt --private-key example.key

【讨论】:

    【解决方案2】:

    如果您打算通过第 3 方软件(例如 Apache HTTP Server)提供 HTTPS 服务,gcloud compute ssl-certificates 不适合您的用例。用于将 SSL 证书添加到托管 GCE HTTPS 负载均衡器。

    只需按照 Apache HTTP Server 的说明安装 SSL 证书,它对 GCE 是透明的,因为它在您的情况下工作在第 3 层。

    【讨论】:

    • 如果可能,您能否提供一个参考链接?我尝试点击此链接:digitalocean.com/community/tutorials/… 但没有成功..
    • (我不是自签名,而是使用.csr文件从GoDaddy获得证书)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-27
    • 2020-09-13
    • 1970-01-01
    • 2021-01-22
    • 2015-10-23
    • 2020-01-29
    相关资源
    最近更新 更多