With openssl 3.4.0 code we are able to generate certificates with key size 1024 and DH param size 1024. Getting the below error when trying to use these certificates for launching a secure http server.
SSL connect err code:[167772559](error:0A00018F:SSL routines::ee key too small)
Error is ee key too small
We would like to know is openSSL 3.4.0 supports certificate key size 1024.
Same api(SSL_CTX_use_certificate) is working fine in 3.1.6.
Is any configuration required to support key size 1024 for legacy applications interaction
/// Code snippet
int err = 0;
SSL_CTX *ctx = NULLPTR;
EVP_PKEY *pkey = NULLPTR;
X509 *cert = NULLPTR;
SSL_load_error_strings();
ERR_load_crypto_strings();
ctx = SSL_CTX_new(SSLv23_method());
if (ctx == NULL){
printf("ssl ctx create error");
return -1
}
fp = opensslFileOpen("mycert.pem");
if (fp == NULL) {
printf("file open error");
return -1
}
cert = PEM_read_X509(fp, NULL, NULL, NULL);
if (cert == NULL) {
printf("file open error");
return -1
}
if (!SSL_CTX_use_certificate(ctx, cert)) {
int err = 0;
if((err = ERR_get_error())) {
printf("SSL connect err code:[%d](%s)\n", err, ERR_error_string(err, NULL));
printf("Error is %s \n",ERR_reason_error_string(err));
return -1;
}
}