I am new to security and OpenSSL. My goal is to programmatically generate a certificate that conveys the "obsolete" shameful behavior that Chrome does. The certificates that I used to generate used AES_128_GCMwith RSA, although I tried to set the encryption list to kEECDH:kEDH:!ADH:AES256-SHA256, but in the context of the server is used SSL_CTX_new(TLSv1_2_server_method());.
Based on an example from the documentation, I tried the following:
X509 *x = NULL;
EVP_PKEY *pk = NULL;
EVP_PKEY_CTX *ctx = NULL;
EVP_PKEY *params = NULL;
if(NULL == (params = EVP_PKEY_new()))
goto err;
if(1 != EVP_PKEY_set1_DH(params, DH_get_2048_256()))
goto err;
if(!(ctx = EVP_PKEY_CTX_new(params, NULL)))
goto err;
if(!EVP_PKEY_keygen_init(ctx))
goto err;
if(!EVP_PKEY_keygen(ctx, &pk))
goto err;
if ((x=X509_new()) == NULL)
goto err;
X509_set_version(x,2);
X509_set_pubkey(x,pk);
if (!X509_sign(x,pk,EVP_sha256()))
goto err;
The same code works for RSAinstead DH. The error that gives X509_signis equal EVP_PKEY_sign_init operation not supported for this keytype.
? , ECDHE, , . , , . , . , , , ( ).