caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
57.04k stars 3.99k forks source link

Preferred curve order #3274

Closed frenchvandal closed 4 years ago

frenchvandal commented 4 years ago

I guess this is not the most essential feature but I was wondering if Caddy can set the preferred elliptic curves in a specific order.

With the API in Caddy 2, we have the ability to custom the elliptic curves to support:

                    "tls_connection_policies": [
                        {
                            "alpn": [
                                "h2"
                            ],
                            "curves": [
                                "x25519",
                                "secp521r1",
                                "secp384r1",
                                "secp256r1"
                            ]
                        }
                    ]

When I check my TLS grade on SSL Labs, the info is: Supported Named Groups secp256r1, secp384r1, secp521r1, x25519 (Server has no preference)

For example, if curves are declared in this field, could it be considered implicitly that their position in the JSON list is the server preferred order? In my example above, x25519 would be used in priority, then secp521r1 and so on.

mholt commented 4 years ago

That's odd, I saw that at first too, but can't reproduce it now.

As far as I can tell, Caddy is working perfectly fine here.

If this is important to your deployment, I'd suggest filing an issue either with Go or with Qualys... or both... since I'm not sure where the problem lies. I'd be super surprised if it was a bug in the Go standard lib, and the Qualys test results do seem inconsistent and unexplainable, to be honest.

So I'm leaning toward a bug in the Qualys test.

Let me know what you find out! Closing for now.