Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing CA certs on Windows #707

Merged
merged 4 commits into from
Mar 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bootstrap.mak
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mingw: $(SRC)

osx: $(SRC)
mkdir -p build/bootstrap
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_MACOSX -I"$(LUA_DIR)" -framework CoreServices $?
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_MACOSX -I"$(LUA_DIR)" -framework CoreServices -framework Foundation -framework Security $?
./build/bootstrap/premake_bootstrap embed
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN`
Expand Down
11 changes: 10 additions & 1 deletion contrib/curl/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project "curl-lib"
language "C"
kind "StaticLib"
includedirs { "include", "lib", "../mbedtls/include/" }
defines { "BUILDING_LIBCURL", "CURL_STATICLIB", "HTTP_ONLY", "USE_MBEDTLS" }
defines { "BUILDING_LIBCURL", "CURL_STATICLIB", "HTTP_ONLY" }
warnings "off"

if not _OPTIONS["no-zlib"] then
Expand All @@ -15,6 +15,15 @@ project "curl-lib"
"**.h",
"**.c"
}

filter { "system:windows" }
defines { "USE_SCHANNEL", "USE_WINDOWS_SSPI" }

filter { "system:macosx" }
defines { "USE_DARWINSSL" }

filter { "system:not windows", "system:not macosx" }
defines { "USE_MBEDTLS" }

filter { "system:linux" }
defines { "CURL_HIDDEN_SYMBOLS" }
Expand Down
9 changes: 7 additions & 2 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
end
if not _OPTIONS["no-curl"] then
includedirs { "contrib/curl/include" }
links { "curl-lib", "mbedtls-lib" }
links { "curl-lib" }
end

files
Expand Down Expand Up @@ -169,9 +169,14 @@
filter "system:linux or hurd"
links { "dl", "rt" }

filter { "system:not windows", "system:not macosx" }
if not _OPTIONS["no-curl"] then
links { "mbedtls-lib" }
end

filter "system:macosx"
defines { "LUA_USE_MACOSX" }
links { "CoreServices.framework" }
links { "CoreServices.framework", "Foundation.framework", "Security.framework" }

filter { "system:macosx", "action:gmake" }
toolset "clang"
Expand Down
12 changes: 12 additions & 0 deletions tests/base/test_http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
end
end

function suite.https_get_verify_peer()
local result, err = http.get("https://httpbin.org/user-agent")
if result then
p.out(result)
test.capture(
'{\n "user-agent": "Premake/' .. _PREMAKE_VERSION .. '"\n}'
)
else
test.fail(err);
end
end

function suite.http_responsecode()
local result, err, responseCode = http.get("http://httpbin.org/status/418")
test.isequal(responseCode, 418)
Expand Down