Open markelkins opened 8 years ago
Please present the commands used to generate certificates/parameters.
openssl genrsa -out ....
Whats the client command used, whats the output of the client command?
The commands were:
openssl ecparam -name secp256r1 -out ec_privkey.pem -genkey
openssl req -new -key ec_privkey.pem -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey ec_privkey.pem -out server.crt
What is the outcome from openssl ciphers -s
.
@markelkins I must mention that your organisation looks very security focused.
Please understand that Restbed is not currently working off the latest version of OpenSSL and 4.0 is on hold until ASIO has merged a pending PR.
If your organisation proceeds with commercial licensing we will reiterate this matter, if it remains unresolved.
@ben-crowhurst I appreciate the warning. For now we are just building a server to test some other products we are working on. If we decide to commercialize our server work, we will definitely need to have more discussion with you.
@markelkins
openssl ecparam -name secp256r1 -out ec_privkey.pem -genkey
Did this succeed?
I looked up openssl ecparam -list_curves
, and secp256r1
was not in the list. The other name for secp256r1
is prime256v1
based on RFC-5480.
Just to be certain, it might be worth trying with -name prime256v1
in case that's confusing OpenSSL.
Okay, so I've finally cracked this beast of a problem but I'm not sure that the fix belongs solely in Restbed's codebase. It's a flaw with Boost's ASIO SSL wrapper as well, because it doesn't contain mechanisms to support ECDHE.
Essentially, it's missing the necessary ASIO API to invoke the equivalent of:
sslSettings->set_temporary_diffie_hellman("file://ec_params.pem");
, but for the ECC (Elliptic Curve Cryptography) implementation. Using set_temporary_diffie_hellman()
will not work.
I have a hack fix in place that I've tested as working, but I need to figure out how to integrate it properly.
I think this will impact any & all algorithms that rely on ECDHE, not just the cipher mentioned in this issue.
Please share the "hack", and great work 👍
So essentially, restbed needs to implement a wrapper around the new ASIO function (from pull request above) in the SSL settings context and use it service_impl.cpp.
I've actually got a working wrapper implemented that I used to test ASIO - just need to clean it up a bit.
This issue will be resolved with the 5.0 release, allowing any socket layer to be inserted into the framework. Public beta branch will be available July 2017.
This will finally be possible July 2021. We will expose a NetworkAdaptor interface that will enable OpenSSL, LibreSSL or any other such functionality.
I need to use HTTPS with the ECDHE-ECDSA-AES128-SHA256 cipher suite, but I cannot seem to get Restbed to use this cipher suite. The error I get is "no shared cipher" when I connect using cURL and specify the cipher suite above. I have configured the server to use a ECC secp256p1 keypair. Any thoughts on how to get this working? I'm working on Darwin 10.3.
For reference here is the code I have so far for the server:
Here are the key files I am using. (Don't worry, they are only temporary keys.)
ec_privkey.pem
server.crt