aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh2
-rw-r--r--src/lpm.c9
-rw-r--r--src/lpm.lua4
3 files changed, 8 insertions, 7 deletions
diff --git a/build.sh b/build.sh
index 21ad04c..29b4932 100755
--- a/build.sh
+++ b/build.sh
@@ -45,7 +45,7 @@ fi
[[ $OSTYPE != 'msys'* && $CC != *'mingw'* && $CC != "emcc" ]] && LDFLAGS="$LDFLAGS -ldl"
[[ $OSTYPE == 'msys'* || $CC == *'mingw'* ]] && LDFLAGS="$LDFLAGS -lbcrypt -lws2_32 -lz -lwinhttp -lole32 -lcrypt32 -lrpcrt4"
-[[ $OSTYPE == *'darwin'* ]] && LDFLAGS="$LDFLAGS -liconv -framework Security"
+[[ $OSTYPE == *'darwin'* ]] && LDFLAGS="$LDFLAGS -liconv -framework Security -framework Foundation"
[[ " $@" != *" -g"* && " $@" != *" -O"* ]] && CFLAGS="$CFLAGS -O3" && LDFLAGS="$LDFLAGS -s"
$CC $CFLAGS $SRCS $@ -o $BIN $LDFLAGS
diff --git a/src/lpm.c b/src/lpm.c
index 818a78a..8fe1a25 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -461,8 +461,8 @@ static int lpm_certs(lua_State* L) {
}
fclose(file);
CertCloseStore(hSystemStore, 0);
- #elseif __APPLE__ // https://developer.apple.com/forums/thread/691009
- CFStringRef keys[] = { kSecClass, kSecMatchLimit, kSecReturnRef };
+ #elif __APPLE__ // https://developer.apple.com/forums/thread/691009; also pulled from curl
+ /*CFStringRef keys[] = { kSecClass, kSecMatchLimit, kSecReturnRef };
CFTypeRef values[] = { kSecClassCertificate, kSecMatchLimitAll, kCFBooleanTrue };
CFDictionaryRef query = CFDictionaryCreate(
NULL,
@@ -476,9 +476,10 @@ static int lpm_certs(lua_State* L) {
OSStatus err = SecItemCopyMatching(query, &copyResult);
if (err == errSecSuccess) {
// Try and
- }
+ }*/
+ return luaL_error(L, "can't use system on mac yet");
#else
- return luaL_error(L, "can't use system certificates on windows or mac");
+ return luaL_error(L, "can't use system certificates except on windows or mac");
#endif
}
git_libgit2_opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, path, NULL);
diff --git a/src/lpm.lua b/src/lpm.lua
index d882613..d875cdf 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -1662,7 +1662,7 @@ in any circumstance unless explicitly supplied.
"/etc/ssl/ca-bundle.pem", -- OpenSUSE
"/etc/pki/tls/cacert.pem", -- OpenELEC
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", -- CentOS/RHEL 7
- "/etc/ssl/cert.pem", -- Alpine Linux
+ "/etc/ssl/cert.pem", -- Alpine Linux (and Mac OSX)
"/etc/ssl/certs", -- SLES10/SLES11, https://golang.org/issue/12139
"/system/etc/security/cacerts", -- Android
"/usr/local/share/certs", -- FreeBSD
@@ -1670,7 +1670,7 @@ in any circumstance unless explicitly supplied.
"/etc/openssl/certs", -- NetBSD
"/var/ssl/certs", -- AIX
}
- if PLATFORM == "windows" or PLATFORM == "darwin" then
+ if PLATFORM == "windows" then
common.mkdirp(TMPDIR)
system.certs("system", TMPDIR .. PATHSEP .. "certs.crt")
else