Add support for the new curve selection API.

Signed-off-by: W-Mark Kubacki <wmark@hurrikane.de>
This commit is contained in:
Mark Kubacki
2015-06-16 20:06:42 +00:00
committed by W-Mark Kubacki
parent 98f8872743
commit 231563682a
3 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,28 @@
--
-- Public domain
--
local socket = require("socket")
local ssl = require("ssl")
local params = {
mode = "client",
protocol = "any",
key = "../certs/clientAkey.pem",
certificate = "../certs/clientA.pem",
cafile = "../certs/rootA.pem",
verify = {"peer", "fail_if_no_peer_cert"},
options = {"all"},
--
curve = "P-256:P-384",
}
local peer = socket.tcp()
peer:connect("127.0.0.1", 8888)
-- [[ SSL wrapper
peer = assert( ssl.wrap(peer, params) )
assert(peer:dohandshake())
--]]
print(peer:receive("*l"))
peer:close()