aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.c
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-01-07 12:00:44 -0500
committerAdam Harrison <adamdharrison@gmail.com>2024-01-07 12:00:44 -0500
commitdd4119770bc2c90c198f92ed17c0272c2e5e7cd2 (patch)
treefcc4f7fe08ebeaeb453d0fcf1ba3539da4977319 /src/lpm.c
parent1feceeabd86785c8edb291143edaeace9d2be22b (diff)
downloadlite-xl-plugin-manager-dd4119770bc2c90c198f92ed17c0272c2e5e7cd2.tar.gz
lite-xl-plugin-manager-dd4119770bc2c90c198f92ed17c0272c2e5e7cd2.zip
Added in changes from @parnikkapore to fix ssl certificates in a directory.
Diffstat (limited to 'src/lpm.c')
-rw-r--r--src/lpm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lpm.c b/src/lpm.c
index 2b6faf2..e614592 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -570,6 +570,14 @@ static int lpm_certs(lua_State* L) {
if (git_initialized)
git_libgit2_opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, NULL, path);
strncpy(git_cert_path, path, MAX_PATH);
+ status = mbedtls_x509_crt_parse_path(&x509_certificate, path);
+ if (status < 0)
+ return luaL_mbedtls_error(L, status, "mbedtls_x509_crt_parse_path failed to parse all CA certificates in %s", path);
+ if (status > 0 && print_trace) {
+ fprintf(stderr, "[ssl] mbedtls_x509_crt_parse_path on %s failed to parse %d certificates, but still succeeded.\n", path, status);
+ fflush(stderr);
+ }
+ mbedtls_ssl_conf_ca_chain(&ssl_config, &x509_certificate, NULL);
if (print_trace) {
fprintf(stderr, "[ssl] SSL directory set to %s.\n", git_cert_path);
fflush(stderr);