mirror of
https://github.com/brunoos/luasec.git
synced 2025-02-13 23:42:49 +01:00
Merge pull request #62 from gleydsonsoares/update_protocol_samples
add TLS_method / rename "sslv23" to "any" / update protocol samples.
This commit is contained in:
commit
8be458ff8a
@ -7,7 +7,7 @@ local util = require("util")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -7,7 +7,7 @@ local util = require("util")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -31,7 +31,7 @@ end
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -3,7 +3,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -3,7 +3,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params01 = {
|
local params01 = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
@ -14,7 +14,7 @@ local params01 = {
|
|||||||
|
|
||||||
local params02 = {
|
local params02 = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAAkey.pem",
|
key = "../certs/serverAAkey.pem",
|
||||||
certificate = "../certs/serverAA.pem",
|
certificate = "../certs/serverAA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/serverBkey.pem",
|
key = "../certs/serverBkey.pem",
|
||||||
certificate = "../certs/serverB.pem",
|
certificate = "../certs/serverB.pem",
|
||||||
cafile = "../certs/rootB.pem",
|
cafile = "../certs/rootB.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -8,7 +8,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -8,7 +8,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -6,7 +6,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -8,7 +8,7 @@ print("Use Ctrl+S and Ctrl+Q to suspend and resume the server.")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "any",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
|
@ -93,7 +93,10 @@ static int set_option_flag(const char *opt, unsigned long *flag)
|
|||||||
*/
|
*/
|
||||||
static LSEC_SSL_METHOD* str2method(const char *method)
|
static LSEC_SSL_METHOD* str2method(const char *method)
|
||||||
{
|
{
|
||||||
if (!strcmp(method, "sslv23")) return SSLv23_method();
|
#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||||
|
#define SSLv23_method TLS_method
|
||||||
|
#endif
|
||||||
|
if (!strcmp(method, "any")) return SSLv23_method();
|
||||||
#ifndef OPENSSL_NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
if (!strcmp(method, "sslv3")) return SSLv3_method();
|
if (!strcmp(method, "sslv3")) return SSLv3_method();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user