SSL 证书不工作 - "no start line" 错误 - Apache2 Ubuntu 16.04.1
SSL Certificate not working - "no start line" Error - Apache2 Ubuntu 16.04.1
我们正在办公室设置一个新的子域并使用我们拥有的通配符 SSL 证书。我已经创建了我的密钥和我的 csr 文件。然后我发送到 csr 文件以获取我现在拥有的 cer 文件。 (我将在 运行 更下方发布命令)。然后,我将文件复制到 /etc/ssl/private 和 /etc/ssl/certs 文件夹中,并在为我们的新域使用 a2ensite 后更新了 apache conf 文件。尝试重新启动 apache 时,显示以下错误消息:
SSL 库错误:error:0906D06C:PEM routines:PEM_read_bio:no 起始行(应为:受信任的证书)-- 错误的文件内容或格式 - 或者甚至只是忘记了 SSLCertificateKeyFile?
Bash 到目前为止我 运行 命令(我省略了域名):
openssl genrsa -des3 -out [domain].key 2048
openssl rsa -in star.[domain].key -out star.[domain].key.insecure
mv star.[domain].key star.[domain].key.secure
mv star.[domain].key.insecure star.[domain].key
openssl req -new -key star.[domain].key -out star.[domain].csr
在创建时请求我们的域时输入 *.[domain],而不是 star.[domain],因为这是我们的提供商所要求的。
然后我们将我们的 csr 文件发送给我们的提供商,并收到我们的 .cer。
我将 .cer 复制到 /etc/ssl/certs/star.[domain].cer 和 /etc/ssl/private/star.[domain].key 然后更新了 apache conf 文件 [subdomain].[域].conf 具有以下内容:
ServerAdmin IT@[domain]
ServerName [subdomain].[domain]
ServerAlias [subdomain].[domain]
SSLCertificateFile /etc/ssl/certs/star.[domain].cer
SSLCertificateKeyFile /etc/ssl/private/star.[domain].key
保存并重启 apache (service apache2 restart) 后,出现上述错误。
最后我解决了这个问题。证书以 pkcs7 格式编码,Ubuntu 不喜欢这种格式。我使用以下命令将证书转换为 PEM,现在一切正常 运行。
openssl pkcs7 -print_certs -in certificate.cer -out certificate.pem
看看这个免费的加密项目
就像三行命令一样,让您的网站繁荣起来,它已加密
以后可能对你有帮助
我们正在办公室设置一个新的子域并使用我们拥有的通配符 SSL 证书。我已经创建了我的密钥和我的 csr 文件。然后我发送到 csr 文件以获取我现在拥有的 cer 文件。 (我将在 运行 更下方发布命令)。然后,我将文件复制到 /etc/ssl/private 和 /etc/ssl/certs 文件夹中,并在为我们的新域使用 a2ensite 后更新了 apache conf 文件。尝试重新启动 apache 时,显示以下错误消息:
SSL 库错误:error:0906D06C:PEM routines:PEM_read_bio:no 起始行(应为:受信任的证书)-- 错误的文件内容或格式 - 或者甚至只是忘记了 SSLCertificateKeyFile?
Bash 到目前为止我 运行 命令(我省略了域名):
openssl genrsa -des3 -out [domain].key 2048
openssl rsa -in star.[domain].key -out star.[domain].key.insecure
mv star.[domain].key star.[domain].key.secure
mv star.[domain].key.insecure star.[domain].key
openssl req -new -key star.[domain].key -out star.[domain].csr
在创建时请求我们的域时输入 *.[domain],而不是 star.[domain],因为这是我们的提供商所要求的。 然后我们将我们的 csr 文件发送给我们的提供商,并收到我们的 .cer。
我将 .cer 复制到 /etc/ssl/certs/star.[domain].cer 和 /etc/ssl/private/star.[domain].key 然后更新了 apache conf 文件 [subdomain].[域].conf 具有以下内容:
ServerAdmin IT@[domain]
ServerName [subdomain].[domain]
ServerAlias [subdomain].[domain]
SSLCertificateFile /etc/ssl/certs/star.[domain].cer
SSLCertificateKeyFile /etc/ssl/private/star.[domain].key
保存并重启 apache (service apache2 restart) 后,出现上述错误。
最后我解决了这个问题。证书以 pkcs7 格式编码,Ubuntu 不喜欢这种格式。我使用以下命令将证书转换为 PEM,现在一切正常 运行。
openssl pkcs7 -print_certs -in certificate.cer -out certificate.pem
看看这个免费的加密项目
就像三行命令一样,让您的网站繁荣起来,它已加密
以后可能对你有帮助