# RV50X AirVantage Error code \[/root/aleos/usr/readyagent/lua/ssl/https.lua:92: tlsv1 alert protocol version\].\]

**URL:** <https://forum.sierrawireless.com/t/rv50x-airvantage-error-code-root-aleos-usr-readyagent-lua-ssl-https-lua-tlsv1-alert-protocol-version/29512>\
**Category:** AirLink Routers\
**Created:** [April 12, 2023, 3:54pm UTC](https://forum.sierrawireless.com/t/rv50x-airvantage-error-code-root-aleos-usr-readyagent-lua-ssl-https-lua-tlsv1-alert-protocol-version/29512 "2023-04-12T15:54:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![terryz](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@terryz](https://forum.sierrawireless.com/u/terryz)\
**Post date:** [April 12, 2023, 3:54pm UTC](https://forum.sierrawireless.com/t/rv50x-airvantage-error-code-root-aleos-usr-readyagent-lua-ssl-https-lua-tlsv1-alert-protocol-version/29512/1 "2023-04-12T15:54:13Z")

</div>

Receiving above error within AirVanage whne trying to upload a file to an RV50X Gateway.

## Below are the files in question, It appears I am using tlsv1\_2 but the error code indicates that the deprecated tlsv1 is being used - what did I miss? Appreciate some insight, thank you! Here is the body of https.lua:

## – SOAP client over HTTPS.

## – See Copyright notice in license.html – $Id: https.lua,v 1.2 2009/05/27 13:22:41 tomas Exp $

local client = require"soap.client"  
–client.https = require"ssl.https"  
client.https = require"soap.client.myhttps"

## Here is the body of myhttps.lua:

## – LuaSec 0.7 – Copyright (C) 2009-2018 PUC-Rio

## – Author: Pablo Musa – Author: Tomas Guisasola

local socket = require(“socket”)  
local ssl = require(“ssl”)  
local ltn12 = require(“ltn12”)  
local http = require(“socket.http”)  
local url = require(“socket.url”)

local try = socket.try

## – – Module

local \_M = {  
\_VERSION = “0.7”,  
\_COPYRIGHT = “LuaSec 0.7 - Copyright (C) 2009-2018 PUC-Rio”,  
PORT = 443,  
TIMEOUT = 60  
}

– TLS configuration  
local cfg = {  
protocol = “tlsv1\_2”,  
options = {“all”, “no\_sslv2”, “no\_sslv3”, “no\_tlsv1”},  
verify = “none”,  
}

* * *

## – Auxiliar Functions

– Insert default HTTPS port.  
local function default\_https\_port(u)  
return url.build(url.parse(u, {port = \_M.PORT}))  
end

– Convert an URL to a table according to Luasocket needs.  
local function urlstring\_totable(url, body, result\_table)  
url = {  
url = default\_https\_port(url),  
method = body and “POST” or “GET”,  
sink = ltn12.sink.table(result\_table)  
}  
require ‘print’ p(“FMW\>\>\>”, url)  
if body then  
url.source = ltn12.source.string(body)  
url.headers = {  
[“content-length”] = #body,  
[“content-type”] = “application/x-www-form-urlencoded”,  
}  
end  
return url  
end

– Forward calls to the real connection object.  
local function reg(conn)  
local mt = getmetatable(conn.sock).\_\_index  
for name, method in pairs(mt) do  
if type(method) == “function” then  
conn[name] = function (self, …)  
return method(self.sock, …)  
end  
end  
end  
end

– Return a function which performs the SSL/TLS connection.  
local function tcp(params)  
params = params or {}  
– Default settings  
for k, v in pairs(cfg) do  
params[k] = params[k] or v  
end  
– Force client mode  
params.mode = “client”  
– ‘create’ function for LuaSocket  
return function ()  
local conn = {}  
conn.sock = try(socket.tcp())  
local st = getmetatable(conn.sock).\_\_index.settimeout  
function conn:settimeout(…)  
return st(self.sock, \_M.TIMEOUT)  
end  
– Replace TCP’s connection function  
function conn:connect(host, port)  
try(self.sock:connect(host, port))  
self.sock = try(ssl.wrap(self.sock, params))  
self.sock:sni(host)  
self.sock:settimeout(\_M.TIMEOUT)  
try(self.sock:dohandshake())  
reg(self, getmetatable(self.sock))  
return 1  
end  
return conn  
end  
end

* * *

## – Main Function

## – Make a HTTP request over secure connection. This function receives – the same parameters of LuaSocket’s HTTP module (except ‘proxy’ and – ‘redirect’) plus LuaSec parameters.

## – @param url mandatory (string or table) – @param body optional (string) – @return (string if url == string or 1), code, headers, status

local function request(url, body)  
print(“MYHTTPS CALLED!!! \>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>”)  
local result\_table = {}  
local stringrequest = type(url) == “string”  
if stringrequest then  
url = urlstring\_totable(url, body, result\_table)  
else  
url.url = default\_https\_port(url.url)  
end  
if http.PROXY or url.proxy then  
return nil, “proxy not supported”  
elseif url.redirect then  
return nil, “redirect not supported”  
elseif url.create then  
return nil, “create function not permitted”  
end  
– New ‘create’ function to establish a secure connection  
url.create = tcp(url)  
local res, code, headers, status = http.request(url)  
if res and stringrequest then  
return table.concat(result\_table), code, headers, status  
end  
return res, code, headers, status  
end

* * *

## – Export module

\_M.request = request

return \_M
