lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Finally, I won't use SCP with LuaCurl because it's impossible.

In order to have a secured access, I want to use with HTTPS, but I don't know how use my certificate.

I have the certificate file and my code looks like this :
require("curl")
c=curl.easy_init()
local f=io.open("X:\My\certificate\file.crt")
cert=f:read("*all")
f:close()
code={}
c:setopt(curl.OPT_URL," https://my.secured.address/afile.txt")
c:setopt(curl.OPT_WRITEFUNCTION,build_w_cb(code))
c:setopt(curl.OPT_SSLCERT,cert)
print(c:perform())

But I have this error message :
58      unable to use client certificate (no key found or wrong pass phrase?)

With curl binary there is no problem....

Thanks !
--
Frédéric ASTIC
06.25.91.07.04