diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-12-31 15:20:22 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-12-31 15:20:22 -0500 |
commit | 1445c34bb2b97f3c7edce93c8ec3c0c0f8f80ca2 (patch) | |
tree | e4fe53ebed0b7cb59794114cd08b20d4f91a1002 /src/lpm.lua | |
parent | 92df608c0f248164d18e51819721876404d82934 (diff) | |
download | lite-xl-plugin-manager-1445c34bb2b97f3c7edce93c8ec3c0c0f8f80ca2.tar.gz lite-xl-plugin-manager-1445c34bb2b97f3c7edce93c8ec3c0c0f8f80ca2.zip |
Updated spec to be clearer about post, and updated lpm to allow for no certificate verification.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 16c20f0..55c16d5 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1607,7 +1607,8 @@ Flags have the following effects: --mod-version Sets the mod version of lite-xl to install plugins. --version Returns version information. --help Displays this help text. - --ssl_certs Sets the SSL certificate store. + --ssl_certs Sets the SSL certificate store. Can be a directory, + or path to a certificate bundle. --arch Sets the architecture (default: ]] .. _G.ARCH .. [[). --assume-yes Ignores any prompts, and automatically answers yes to all. @@ -1624,6 +1625,8 @@ in any circumstance unless explicitly supplied. binaries if there is a native compilation step. --remotes Automatically adds any specified remotes in the repository to the end of the resolution list. + --ssl_certs=noverify Ignores SSL certificate validation. Opens you up to + man-in-the-middle attacks. ]] ) return 0 @@ -1652,9 +1655,13 @@ in any circumstance unless explicitly supplied. repositories = {} if ARGS[2] == "purge" then return lpm_purge() end if ARGS["ssl_certs"] then - local stat = system.stat(ARGS["ssl_certs"]) - if not stat then error("can't find " .. ARGS["ssl_certs"]) end - system.certs(stat.type, ARGS["ssl_certs"]) + if ARGS["ssl_certs"] == "noverify" then + system.certs("noverify") + else + local stat = system.stat(ARGS["ssl_certs"]) + if not stat then error("can't find " .. ARGS["ssl_certs"]) end + system.certs(stat.type, ARGS["ssl_certs"]) + end elseif not os.getenv("SSL_CERT_DIR") and not os.getenv("SSL_CERT_FILE") then local paths = { -- https://serverfault.com/questions/62496/ssl-certificate-location-on-unix-linux#comment1155804_62500 "/etc/ssl/certs/ca-certificates.crt", -- Debian/Ubuntu/Gentoo etc. |