Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server.crt证书过期导致Mac端无法连接服务器 #131

Closed
LITDARK opened this issue May 20, 2020 · 2 comments
Closed

server.crt证书过期导致Mac端无法连接服务器 #131

LITDARK opened this issue May 20, 2020 · 2 comments

Comments

@LITDARK
Copy link

LITDARK commented May 20, 2020

crt
移动端正常,Mac端无法连接服务器,关闭解锁恢复正常。

@yu1ec
Copy link

yu1ec commented May 20, 2020

可以自签证书,然后传入lede路由里
用哪个版本的就替换哪个版本里面的证书,我用的是go版本的,所以只替换了go版本内的证书文件

nodejs版本证书存放路径: /usr/share/UnblockNeteaseMusic
go版本的证书存放路径: /usr/share/UnblockNeteaseMusicGo

签完以后,替换三个文件即可:

  • ca.crt
  • server.crt
  • server.key

补充一句,为了防止短路,最好先把服务停了再替换证书,我们修电脑的时候,一般都要先关机卸电池。

不过,我手头没有苹果设备,得明天去了公司以后借设计妹子的手机和电脑试试。

自签方法

# 生成 CA 私钥
openssl genrsa -out ca.key 2048

# 生成 CA 证书 ("YOURNAME" 处填上你自己的名字)
openssl req -x509 -new -nodes -key ca.key -sha256 -days 1825 -out ca.crt -subj "/C=CN/CN=UnblockNeteaseMusic Root CA/O=MusicFree"

# 生成服务器私钥
openssl genrsa -out server.key 2048

# 生成证书签发请求
openssl req -new -sha256 -key server.key -out server.csr -subj "/C=CN/L=Hangzhou/O=NetEase (Hangzhou) Network Co., Ltd/OU=IT Dept./CN=*.music.163.com"

# 使用 CA 签发服务器证书
openssl x509 -req -extfile <(printf "extendedKeyUsage=serverAuth\nsubjectAltName=DNS:music.163.com,DNS:*.music.163.com") -sha256 -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt

@LITDARK
Copy link
Author

LITDARK commented May 20, 2020

可以自签证书,然后传入lede路由里
用哪个版本的就替换哪个版本里面的证书,我用的是go版本的,所以只替换了go版本内的证书文件

nodejs版本证书存放路径: /usr/share/UnblockNeteaseMusic go版本的证书存放路径: /usr/share/UnblockNeteaseMusicGo

签完以后,替换三个文件即可:

  • ca.crt
  • server.crt
  • server.key

补充一句,为了防止短路,最好先把服务停了再替换证书,我们修电脑的时候,一般都要先关机卸电池。

不过,我手头没有苹果设备,得明天去了公司以后借设计妹子的手机和电脑试试。

自签方法

# 生成 CA 私钥
openssl genrsa -out ca.key 2048

# 生成 CA 证书 ("YOURNAME" 处填上你自己的名字)
openssl req -x509 -new -nodes -key ca.key -sha256 -days 1825 -out ca.crt -subj "/C=CN/CN=UnblockNeteaseMusic Root CA/O=MusicFree"

# 生成服务器私钥
openssl genrsa -out server.key 2048

# 生成证书签发请求
openssl req -new -sha256 -key server.key -out server.csr -subj "/C=CN/L=Hangzhou/O=NetEase (Hangzhou) Network Co., Ltd/OU=IT Dept./CN=*.music.163.com"

# 使用 CA 签发服务器证书
openssl x509 -req -extfile <(printf "extendedKeyUsage=serverAuth\nsubjectAltName=DNS:music.163.com,DNS:*.music.163.com") -sha256 -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt

感谢 已经恢复正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants