$ gmssl.exe s_client -debug -status -security_debug -config ./openssl.cnf -port "9999" -CAfile "Root.crt" -cert "Client.crt" -key "Client.key"
客户端证书可以不设置
$ gmssl.exe s_server -debug -status_verbose -security_debug -config ./openssl.cnf -port "9999" -servername "gmservername" -CAfile "Root.crt" -cert "Server.crt" -key "Server.key" -cert2 "Server1.crt" -key2 "Server1.key"
第二个证书cert2和第二个私钥key2可以不设置,如果要让第二个证书和私钥起作用需要设置-servername "随便设置一个名字",不过设置了 -servername参数后,有一个堆栈溢出的BUG,需要修改一下,具体修改内容如下:
static int security_callback_debug(const SSL *s, const SSL_CTX *ctx,
int op, int bits, int nid,
void *other, void *ex)
{
security_debug_ex *sdb = ex;
int rv = 1, show_bits = 1, cert_md = 0;//rv赋值1
const char *nm;
//rv = sdb->old_cb(s, ctx, op, bits, nid, other, ex);//注释掉这行
//if (rv == 1 && sdb->verbose < 2)//注释掉这行
// return 1;//注释掉这行
BIO_puts(sdb->out, "SecCB: ");
国密客户端Client与服务器Server交互
最新推荐文章于 2024-09-01 07:31:07 发布
本文详细探讨了国密GMSSL技术在客户端与服务器之间的交互过程,包括安全认证、密钥协商等关键步骤,旨在提升网络安全和数据保护能力。

最低0.47元/天 解锁文章
476

被折叠的 条评论
为什么被折叠?



