$ 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, b
国密客户端Client与服务器Server交互
最新推荐文章于 2025-02-25 13:36:38 发布