Project

General

Profile

[Solved] Unable to provide more than one curve in ec-curve

Added by a16474 almost 6 years ago

I want to configure more than one ec-curve by specifying the following in the httpd confiuration file

The below works:
ssl.ec-curve = "secp384r1"

But when i try to configure more than one ec curves then it fails:
ssl.ec-curve = "secp384r1:secp256r1"

please let me know how can i configure more than two ec curves. i have tried specifying curves separating using blank space . comma and semi colon


Replies (5)

RE: [Solved] Unable to provide more than one curve in ec-curve - Added by gstrauss almost 6 years ago

ssl.openssl.ssl-conf-cmd in lighttpd 1.4.48 is similar to the Apache mod_ssl SSLOpenSSLConfCmd directive, but requires lighttpd 1.4.48 or later and openssl 1.0.2 or later.

e.g. ssl.openssl.ssl-conf-cmd = ("Curves" => "secp384r1:prime256v1")

https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html

lighttpd takes "file commands" not "command line commands" as openssl SSL_CONF_cmd() appears to permit only one mode at a time.

RE: [Solved] Unable to provide more than one curve in ec-curve - Added by a16474 almost 6 years ago

We tried all of the below but it is not working. Unable to setup TLS on curve secp384v1

ssl.openssl.ssl-conf-cmd = ("Curves" => "P-384")
ssl.openssl.ssl-conf-cmd = ("Curves" => "P-384:P-256")
ssl.openssl.ssl-conf-cmd = ("Curves" => " secp384r1")
ssl.openssl.ssl-conf-cmd = ("Curves" => "secp384r1:prime256v1")

RE: [Solved] Unable to provide more than one curve in ec-curve - Added by gstrauss almost 6 years ago

Did you test with: $ openssl s_client -connect example.com:443 ?

What version of openssl do you have?

ssl.openssl.ssl-conf-cmd = ("Curves" => "secp384r1:prime256v1") works for me, as does ssl.openssl.ssl-conf-cmd = ("Curves" => "secp384r1")

RE: [Solved] Unable to provide more than one curve in ec-curve - Added by a16474 almost 6 years ago

These are the versions we are using:
root@transport:~ >openssl version
OpenSSL 1.0.2p-dev xx XXX xxxx
root@transport:~ >

root@transport:~ >lighttpd -v
lighttpd/1.4.49-devel-FB_FSM3_LFS_REL_2017_12_0046 (ssl) - a light and fast webserver
root@transport:~ >

1. When we do not specify any curve in lighttpd.conf file then it selects prime256v1 curve by default.
2. When we use below configuration inside lighttpd.conf file:
a. ssl.openssl.ssl-conf-cmd = ("Curves" => "secp384r1:prime256v1")

Result: Connection doesn’t happen with secp384r1, But when we change to prime256v1 it works fine.

[root@localhost ~]# openssl s_client -connect 10.43.39.5:443 -cipher ECDHE-RSA-AES256-GCM-SHA384 -curves secp384r1 -msg -bugs
CONNECTED

TLS 1.2 [length 0005]

16 03 01 00 6e

TLS 1.2 Handshake [length 006e], ClientHello

01 00 00 6a 03 03 a7 35 b4 0f 27 d7 fd 32 b1 f2
66 39 f8 56 ec 18 ae 4a 5e 68 20 72 29 0d 60 4a
01 5d fa a6 e3 37 00 00 04 c0 30 00 ff 01 00 00
3d 00 0b 00 04 03 00 01 02 00 0a 00 04 00 02 00
18 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06
03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03
02 03 03 02 01 02 02 02 03 00 0f 00 01 01
<<< TLS 1.2 [length 0005]
15 03 03 00 02
<<< TLS 1.2 Alert [length 0002], fatal handshake_failure
02 28
139842944988840:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:802:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 115 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1530687767
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
[root@localhost ~]#

3. When we use below configuration inside lighttpd.conf file:
a. ssl.openssl.ssl-conf-cmd = ("Curves" => "secp384r1")

Result: Connection doesn’t happen with both secp384r1 and prime256v1.

[root@localhost ~]# openssl s_client -connect 10.43.39.5:443 -cipher ECDHE-RSA-AES256-GCM-SHA384 -curves prime256v1 -msg -bugs
CONNECTED

TLS 1.2 [length 0005]

16 03 01 00 6e

TLS 1.2 Handshake [length 006e], ClientHello

01 00 00 6a 03 03 d9 3d 0e 43 6e eb 33 37 fa 1a
6e bc 2d e0 fd 44 2b 67 30 15 68 3b d1 81 0a 45
25 45 46 9b 1a 2e 00 00 04 c0 30 00 ff 01 00 00
3d 00 0b 00 04 03 00 01 02 00 0a 00 04 00 02 00
17 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06
03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03
02 03 03 02 01 02 02 02 03 00 0f 00 01 01
<<< TLS 1.2 [length 0005]
15 03 03 00 02
<<< TLS 1.2 Alert [length 0002], fatal handshake_failure
02 28
140173571421864:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:802:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 115 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1530688097
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
[root@localhost ~]#

[root@localhost ~]# openssl s_client -connect 10.43.39.5:443 -cipher ECDHE-RSA-AES256-GCM-SHA384 -curves secp384r1 -msg -bugs
CONNECTED

TLS 1.2 [length 0005]

16 03 01 00 6e

TLS 1.2 Handshake [length 006e], ClientHello

01 00 00 6a 03 03 1b d9 6b 9a d8 cb 80 94 97 30
c9 cc 27 34 8d 54 91 cb 19 a5 11 51 b8 97 d6 2e
dc c0 23 9a a3 ac 00 00 04 c0 30 00 ff 01 00 00
3d 00 0b 00 04 03 00 01 02 00 0a 00 04 00 02 00
18 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06
03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03
02 03 03 02 01 02 02 02 03 00 0f 00 01 01
<<< TLS 1.2 [length 0005]
15 03 03 00 02
<<< TLS 1.2 Alert [length 0002], fatal handshake_failure
02 28
140067574486696:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:802:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 115 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1530688208
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
[root@localhost ~]#

To conclude, we couldn’t establish successful connection with secp384r1 curve with the approach lighttpd forum has provided.

It is working in your setup because in the command "openssl s_client -connect example.com:443" you don't specify secp384r1 so it's probably getting set in prime256v1

    (1-5/5)