[openssl-users] How to use RSA certificate and ECC certificate simutaneously

Viktor Dukhovni openssl-users at dukhovni.org
Tue Nov 20 15:44:59 UTC 2018


> On Nov 20, 2018, at 9:48 AM, maoly527 <maoly527 at 163.com> wrote:
> 
> Does anyone know how to use RSA and ECC certificate simultaneously in one server?

You just configure two private keys and two certificate chains by calling:

  if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0) {
	/* error */;
  }
  if (SSL_CTX_use_PrivateKey_file(ctx, key_file, SSL_FILETYPE_PEM) <= 0) {
       /* error */;
  }
  if (SSL_CTX_check_private_key(ctx) != 0) {
	/* error */;
  }	

once for each "cert_file" and associated "key_file" (the same file often
holds both, in which case cert_file == key_file).  The SSL error stack
will contain error details.

The SSL library will automatically select the appropriate key and certificate
chain.

-- 
	Viktor.



More information about the openssl-users mailing list