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

create a self-signed certificate for a subdomain, the main domain does not belong to me

· 52CE 我爱测

I have my internet box provider who offers me a free subdomain to connect to my network, ex: xxxxx.provider.com I have generated a self-signed certificate for the subdomain foo.provider.com I tried to install it in windows but it…

问题原文

原帖链接 · Pascal de Sélys · CC BY-SA 4.0

I have my internet box provider who offers me a free subdomain to connect to my network, ex: xxxxx.provider.com

I have generated a self-signed certificate for the subdomain foo.provider.com I tried to install it in windows but it does not validate my certificate NET::ERR_CERT_COMMON_NAME_INVALID

Is it possible to generate a self-signed certificate on a subdomain and the main domain name does not belong to us?

已采纳解答

原帖链接 · Pascal de Sélys · CC BY-SA 4.0

The comment to my post by dave_thompson_085 helped me solve this,

I added -addext "subjectAltName = DNS:xxxx.provider.com" and reimported the certificate into windows and it works fine now

Here is the command I used to generate my self-signed certificate

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -addext "subjectAltName = DNS:xxxx.provider.com" -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

I then answered Common Name (e.g. server FQDN or YOUR name) []: xxxx.provider.com

I then imported the certificate into my certificate manager in windows and it worked

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

资料来源与适用范围

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

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

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