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

生成证书失败 Key type does not match parameters #307

Closed
yangboyd opened this issue Sep 24, 2022 · 2 comments
Closed

生成证书失败 Key type does not match parameters #307

yangboyd opened this issue Sep 24, 2022 · 2 comments

Comments

@yangboyd
Copy link

https://github.com/Tongsuo-Project/Tongsuo/wiki/%E4%BD%BF%E7%94%A8BabaSSL%E7%AD%BE%E5%8F%91SM2%E5%8F%8C%E8%AF%81%E4%B9%A6

openssl req -config subca.cnf -newkey ec:server_sm2.param -nodes -keyout server_sign.key -sm3 -sigopt "sm2_id:1234567812345678" -new -out server_sign.csr -subj "/C=AA/ST=BB/O=CC/OU=DD/CN=server sign"

Key type does not match parameters

@yangboyd
Copy link
Author

openssl req -new -key sm2.key -out sm2.csr -sm3 -sigopt "sm2_id:1234567812345678"

Can't open "OSSL$DATAROOT:[000000]openssl.cnf" for reading, No such file or directory
4057BFAADB7F0000:error:80000002:system library:(unknown function):No such file or directory:crypto/bio/bss_file.c:67:calling fopen(OSSL$DATAROOT:[000000]openssl.cnf, r)
4057BFAADB7F0000:error:10000080:BIO routines:(unknown function):no such file:crypto/bio/bss_file.c:75:

@wa5i
Copy link
Contributor

wa5i commented Oct 19, 2022

openssl req -new -key sm2.key -out sm2.csr -sm3 -sigopt "sm2_id:1234567812345678"

Can't open "OSSL$DATAROOT:[000000]openssl.cnf" for reading, No such file or directory 4057BFAADB7F0000:error:80000002:system library:(unknown function):No such file or directory:crypto/bio/bss_file.c:67:calling fopen(OSSL$DATAROOT:[000000]openssl.cnf, r) 4057BFAADB7F0000:error:10000080:BIO routines:(unknown function):no such file:crypto/bio/bss_file.c:75:

通过参数-config 指定一下openssl.cnf,参考一下:

/opt/tongsuo/bin/tongsuo req -new -key sm2.key -out sm2.csr -sm3 -config /opt/tongsuo/ssl/openssl.cnf

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