Skip to content

Commit 8194df9

Browse files
committed
Merge remote-tracking branch 'origin/refs/pull/154/head'
2 parents d98cd0c + f9bbff8 commit 8194df9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

http/tls.lua

+10-2
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,11 @@ local function new_client_context()
755755
local ctx = openssl_ctx.new("TLS", false)
756756
ctx:setCipherList(intermediate_cipher_list)
757757
ctx:setOptions(default_tls_options)
758-
ctx:setEphemeralKey(openssl_pkey.new{ type = "EC", curve = "prime256v1" })
758+
if ctx.setGroups then
759+
ctx:setGroups("P-521:P-384:P-256")
760+
else
761+
ctx:setEphemeralKey(openssl_pkey.new{ type = "EC", curve = "prime256v1" })
762+
end
759763
local store = ctx:getStore()
760764
store:addDefaults()
761765
ctx:setVerify(openssl_ctx.VERIFY_PEER)
@@ -766,7 +770,11 @@ local function new_server_context()
766770
local ctx = openssl_ctx.new("TLS", true)
767771
ctx:setCipherList(intermediate_cipher_list)
768772
ctx:setOptions(default_tls_options)
769-
ctx:setEphemeralKey(openssl_pkey.new{ type = "EC", curve = "prime256v1" })
773+
if ctx.setGroups then
774+
ctx:setGroups("P-521:P-384:P-256")
775+
else
776+
ctx:setEphemeralKey(openssl_pkey.new{ type = "EC", curve = "prime256v1" })
777+
end
770778
return ctx
771779
end
772780

0 commit comments

Comments
 (0)