大网数据广告活动
服务器运维问答

Creating csr for SSL request on Ubuntu gives error

· 52CE 我爱测

I am trying to create SSL certification on my website. To, create csr , I used the command: openssl req –new –newkey rsa:2048 –nodes –keyout mydomain.key –out mydomain.csr But,I get the error saying: req: Use -help for summary. I…

问题原文

原帖链接 · Biplove Lamichhane · CC BY-SA 4.0

I am trying to create SSL certification on my website. To, create csr , I used the command:

openssl req –new –newkey rsa:2048 –nodes –keyout mydomain.key –out mydomain.csr

But,I get the error saying:

req: Use -help for summary.

I checked if openssl is installed or not, and it gives the version. So, it is installed.

I don't know what to do. I am fairly new to this. This is my first try to get the SSL.

I am having hard time.

已采纳解答

原帖链接 · Marat Gainutdinov · CC BY-SA 4.0

Generate and sign the private key for my.domain.com using openssl.

Create a new encrypted private key.

openssl genrsa -aes128 -out /etc/pki/tls/private/httpdkey.pem

Enter httpd at the passphrase prompt (or just press empty). Generate a self-signed certificate using the key.

openssl req -new -x509 -key /etc/pki/tls/private/httpdkey.pem -out /etc/pki/tls/certs/httpdcert.pem -days 365

OR

  • Generate a certificate signing request to be sent to a certificate authority:
openssl req -new -sha256 -key {{filename.key}} -out {{filename.csr}}
  • Generate a self-signed certificate from a certificate signing request valid for some number of days:
openssl x509 -req -days {{days}} -in {{filename.csr}} -signkey {{filename.key}} -out {{filename.crt}}

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-06-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。