<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hi,</div><div>I'm trying to establish a TLS/SSL connection between 2 back-end using OpenSSL library. </div><div>The algorithm I would like to use is ECDHE-RSA-AES256-SHA.</div><div>At first, I want to generate 2 pairs of ECDH-RSA certificate/key, 1 for the server & 1 for the client using a root CA as a signed authority. To simplify everthing, I want to insert a fixed ECDH parameters into the RSA certificate. For that I came up with the following solution </div><div>Here are the commands I used to generate these 2 certificate:</div><div><br data-mce-bogus="1"></div><div>#Root CA<br>openssl genrsa -out rootCA.key 2048 -aes256<br>openssl req -x509 -new -nodes -key rootCA.key -days 36500 -out rootCA.pem<br><br>#ECDH params<br>openssl ecparam -out ecparam.pem -name prime256v1<br>openssl genpkey -paramfile ecparam.pem -out eckey.pem<br><br>#ECDH certificate client<br>openssl genrsa -out rsaclient.key 2048 -aes256<br>openssl pkey -in eckey.pem -pubout -out ecpubkeyclient.pem<br>openssl req -new -key rsaclient.key -out rsaclient.csr -days 36500<br><br>#signed ECDH certificate client<br>openssl x509 -req -in rsaclient.csr -CAkey rootCA.key -CA rootCA.pem -force_pubkey ecpubkeyclient.pem -out eccertclient.pem -CAcreateserial<br><br>#ECDH certificate server<br>openssl genrsa -out rsaserver.key 2048 -aes256<br>openssl pkey -in eckey.pem -pubout -out ecpubkeyserver.pem<br>openssl req -new -key rsaserver.key -out rsaserver.csr -days 36500<br><br>#signed ECDH certificate server<br>openssl x509 -req -in rsaserver.csr -CAkey rootCA.key -CA rootCA.pem -force_pubkey ecpubkeyserver.pem -out eccertserver.pem -CAcreateserial</div><div><br data-mce-bogus="1"></div><div>If I understand correctly, I will obtain: </div><div>Root key: rootCA.key<br>Root certificate: rootCA.pem <br>ECDH client: eccertclient.pem<br>ECDH client private key: rsaclient.key<br>ECDH server: eccertserver.pem<br>ECDH server private key: rsaserver.key</div><div><br data-mce-bogus="1"></div><div>However, when I used SSL_CTX_check_private_key to check between eccertserver.pem & rsaserver.key, an error was occured.</div><div>Is there anything I did was wrong when I use the commands.</div><div>Any help would be appriciate, thanks in advance.</div><div>Best regards,</div><div><br></div><div data-marker="__SIG_POST__">-- <br></div><div><br>Huy Cong<br>06 69 07 97 82<br>Wandercraft SAS</div></div></body></html>