luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.

Home Page:http://lit.luvit.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

coro-http: Error verifying peer: unable to get local issuer certificate

Uppernate opened this issue · comments

So a site that I HTTP GET information from has updated their SSL certificates because of a "Chrome distrust" issue. Now I get the error that is in the title and an immediate crash for "cannot resume dead coroutine"

Full error log:

command:verify Error:
D:/Discord Bots/ClickBot/deps/coro-http.lua:74: Error verifying peer: unable to get local issuer certificate
Uncaught Error: D:/Discord Bots/ClickBot/deps/secure-socket/biowrap.lua:56: cannot resume dead coroutine
stack traceback:
[C]: in function 'handshakeComplete'
D:/Discord Bots/ClickBot/deps/secure-socket/biowrap.lua:56: in function <D:/Discord Bots/ClickBot/deps/secure-socket/biowrap.lua:49>
[C]: in function 'run'
[string "bundle:init.lua"]:52: in function <[string "bundle:init.lua"]:47>
[C]: in function 'xpcall'
[string "bundle:init.lua"]:47: in function 'fn'
[string "bundle:deps/require.lua"]:310: in function <[string "bundle:deps/require.lua"]:266>

Code snippet, fairly simple GET request:

local http = require("coro-http")
...
function verify(...)
local full = "this is where the url would be made with user's parameters"
local request, data = http.request("GET", full)
end

Site in question is https://community.clickteam.com/forum.php

This is pretty late sorry for that, but if you are still interested here it is:

As you might have knew, coro-http is suppose to be called inside a coroutine (hence the coro in the name), since it WILL try to yield in specific cases.

Therefor your code should've been looked something like

local http = require("coro-http")

coroutine.wrap(function()
  local request, data = http.request("GET", url)
end)()

or something along these lines. You could read more about coroutines for more information about that.

If you are no longer interested or this solves your issue you could close this 😄