Skip to content

Commit

Permalink
style: omit parentheses only one argument
Browse files Browse the repository at this point in the history
  • Loading branch information
detailyang committed May 7, 2017
1 parent b19447d commit 5c04464
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions t/ssl-ctx.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ init_by_lua_block {
local cert = ssl.parse_pem_cert(read_file("$TEST_NGINX_HTML_DIR/client.crt"))
local priv_key = ssl.parse_pem_priv_key(read_file("$TEST_NGINX_HTML_DIR/client.unsecure.key"))

local ssl_ctx, err = ssl.create_ctx({
local ssl_ctx, err = ssl.create_ctx{
priv_key = priv_key,
cert = cert
})
}

c:set("sslctx", ssl_ctx)

Expand Down Expand Up @@ -195,7 +195,7 @@ __DATA__
location /t{
content_by_lua_block {
local ssl = require "ngx.ssl"
local ssl_ctx, err = ssl.create_ctx()
local ssl_ctx, err = ssl.create_ctx{}
if ssl_ctx == nil then
ngx.say(err)
end
Expand All @@ -217,11 +217,11 @@ no options found
local ssl = require "ngx.ssl"
local cert = ssl.parse_pem_cert(read_file("$TEST_NGINX_HTML_DIR/client.crt"))
local priv_key = ssl.parse_pem_priv_key(read_file("$TEST_NGINX_HTML_DIR/client.unsecure.key"))
local ssl_ctx, err = ssl.create_ctx({
local ssl_ctx, err = ssl.create_ctx{
protocols = protocols,
priv_key = priv_key,
cert = cert
})
}
if ssl_ctx == nil then
return err
end
Expand Down Expand Up @@ -269,10 +269,10 @@ TLSv1.2
local ssl = require "ngx.ssl"
local cert = ssl.parse_pem_cert(read_file("$TEST_NGINX_HTML_DIR/server.crt"))
local priv_key = ssl.parse_pem_priv_key(read_file("$TEST_NGINX_HTML_DIR/client.unsecure.key"))
local ssl_ctx, err = ssl.create_ctx({
local ssl_ctx, err = ssl.create_ctx{
priv_key = priv_key,
cert = cert
})
}
if ssl_ctx == nil then
ngx.say(err)
end
Expand All @@ -294,10 +294,10 @@ error:0B080074:x509 certificate routines:X509_check_private_key:key values misma
local cert = ssl.parse_pem_cert(read_file("$TEST_NGINX_HTML_DIR/client.crt"))
local priv_key = ssl.parse_pem_priv_key(read_file("$TEST_NGINX_HTML_DIR/client.unsecure.key"))

local ssl_ctx, err = ssl.create_ctx({
local ssl_ctx, err = ssl.create_ctx{
priv_key = priv_key,
cert = cert
})
}

if ssl_ctx == nil then
ngx.say("failed to init ssl ctx: ", err)
Expand Down

0 comments on commit 5c04464

Please sign in to comment.