mirror of
https://github.com/brunoos/luasec.git
synced 2024-12-26 12:48:20 +01:00
Update samples (using 'tlsv1').
This commit is contained in:
parent
49ea6b8ba6
commit
64faf6322e
@ -12,7 +12,7 @@ local params = {
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local conn = socket.tcp()
|
||||
|
@ -12,7 +12,7 @@ local params = {
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local ctx = assert(ssl.newcontext(params))
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local peer = socket.tcp()
|
||||
|
@ -31,12 +31,12 @@ end
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
dhparam = dhparam_cb,
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local peer = socket.tcp()
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
--
|
||||
curve = "secp384r1",
|
||||
}
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
--
|
||||
curve = "secp384r1",
|
||||
}
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local peer = socket.tcp()
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
while true do
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
-- [[ SSL context
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
while true do
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
-- [[ SSL context
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local peer = socket.tcp()
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../../certs/clientBkey.pem",
|
||||
certificate = "../../certs/clientB.pem",
|
||||
cafile = "../../certs/rootB.pem",
|
||||
verify = {"none"},
|
||||
options = {"all", "no_sslv2"},
|
||||
verify = "none",
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local peer = socket.tcp()
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../../certs/serverAkey.pem",
|
||||
certificate = "../../certs/serverA.pem",
|
||||
cafile = "../../certs/rootA.pem",
|
||||
verify = {"none"},
|
||||
options = {"all", "no_sslv2"},
|
||||
verify = "none",
|
||||
options = "all",
|
||||
}
|
||||
|
||||
-- [[ SSL context
|
||||
|
@ -6,13 +6,13 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../../certs/clientBkey.pem",
|
||||
certificate = "../../certs/clientB.pem",
|
||||
cafile = "../../certs/rootB.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
verifyext = {"lsec_continue"},
|
||||
options = "all",
|
||||
verifyext = "lsec_continue",
|
||||
}
|
||||
|
||||
-- [[ SSL context
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../../certs/serverAkey.pem",
|
||||
certificate = "../../certs/serverA.pem",
|
||||
cafile = "../../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
verifyext = {"lsec_continue", "crl_check", "crl_check_chain"},
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../../certs/clientAkey.pem",
|
||||
certificate = "../../certs/clientA.pem",
|
||||
cafile = "../../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local peer = socket.tcp()
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../../certs/serverAkey.pem",
|
||||
certificate = "../../certs/serverA.pem",
|
||||
cafile = "../../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ local params = {
|
||||
cafile = "../certs/rootB.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
verifyext = {"lsec_continue", "lsec_ignore_purpose"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local ctx = assert(ssl.newcontext(params))
|
||||
|
@ -12,7 +12,7 @@ local params = {
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
verifyext = {"lsec_continue", "lsec_ignore_purpose"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,12 +8,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
-- Wait until socket is ready (for reading or writing)
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
-- [[ SSL context
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,12 +8,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
-- [[ SSL context
|
||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
||||
|
||||
local params = {
|
||||
mode = "client",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/clientAkey.pem",
|
||||
certificate = "../certs/clientA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
local function wait(peer, err)
|
||||
|
@ -8,12 +8,12 @@ print("Use Ctrl+S and Ctrl+Q to suspend and resume the server.")
|
||||
|
||||
local params = {
|
||||
mode = "server",
|
||||
protocol = "sslv3",
|
||||
protocol = "tlsv1",
|
||||
key = "../certs/serverAkey.pem",
|
||||
certificate = "../certs/serverA.pem",
|
||||
cafile = "../certs/rootA.pem",
|
||||
verify = {"peer", "fail_if_no_peer_cert"},
|
||||
options = {"all", "no_sslv2"},
|
||||
options = "all",
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user