Skip to content

Commit 2e4996d

Browse files
authored
Merge pull request #1237 from lightpanda-io/nikneym/curl-use-boringssl
Prefer BoringSSL as TLS backend
2 parents 927cbe7 + 3f8ad1a commit 2e4996d

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
needs: zig-build-release
123123

124124
env:
125-
MAX_MEMORY: 27000
125+
MAX_MEMORY: 28000
126126
MAX_AVG_DURATION: 23
127127
LIGHTPANDA_DISABLE_TELEMETRY: true
128128

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
[submodule "vendor/nghttp2"]
2323
path = vendor/nghttp2
2424
url = https://github.com/nghttp2/nghttp2.git
25-
[submodule "vendor/mbedtls"]
26-
path = vendor/mbedtls
27-
url = https://github.com/Mbed-TLS/mbedtls.git
2825
[submodule "vendor/zlib"]
2926
path = vendor/zlib
3027
url = https://github.com/madler/zlib.git

build.zig

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,27 @@ fn addDependencies(b: *Build, mod: *Build.Module, opts: *Build.Step.Options) !vo
374374
mod.addCMacro("STDC_HEADERS", "1");
375375
mod.addCMacro("TIME_WITH_SYS_TIME", "1");
376376
mod.addCMacro("USE_NGHTTP2", "1");
377-
mod.addCMacro("USE_MBEDTLS", "1");
377+
mod.addCMacro("USE_OPENSSL", "1");
378+
mod.addCMacro("OPENSSL_IS_BORINGSSL", "1");
378379
mod.addCMacro("USE_THREADS_POSIX", "1");
379380
mod.addCMacro("USE_UNIX_SOCKETS", "1");
380381
}
381382

382383
try buildZlib(b, mod);
383384
try buildBrotli(b, mod);
384-
try buildMbedtls(b, mod);
385+
const boringssl_dep = b.dependency("boringssl-zig", .{
386+
.target = target,
387+
.optimize = mod.optimize.?,
388+
.force_pic = true,
389+
});
390+
391+
const ssl = boringssl_dep.artifact("ssl");
392+
ssl.bundle_ubsan_rt = false;
393+
const crypto = boringssl_dep.artifact("crypto");
394+
crypto.bundle_ubsan_rt = false;
395+
396+
mod.linkLibrary(ssl);
397+
mod.linkLibrary(crypto);
385398
try buildNghttp2(b, mod);
386399
try buildCurl(b, mod);
387400
try buildAda(b, mod);
@@ -842,8 +855,9 @@ fn buildCurl(b: *Build, m: *Build.Module) !void {
842855
root ++ "lib/vauth/spnego_sspi.c",
843856
root ++ "lib/vauth/vauth.c",
844857
root ++ "lib/vtls/cipher_suite.c",
845-
root ++ "lib/vtls/mbedtls.c",
846-
root ++ "lib/vtls/mbedtls_threadlock.c",
858+
root ++ "lib/vtls/openssl.c",
859+
root ++ "lib/vtls/hostcheck.c",
860+
root ++ "lib/vtls/keylog.c",
847861
root ++ "lib/vtls/vtls.c",
848862
root ++ "lib/vtls/vtls_scache.c",
849863
root ++ "lib/vtls/x509asn1.c",

build.zig.zon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
.url = "https://github.com/ada-url/ada/releases/download/v3.3.0/singleheader.zip",
1414
.hash = "N-V-__8AAPmhFAAw64ALjlzd5YMtzpSrmZ6KymsT84BKfB4s",
1515
},
16+
.@"boringssl-zig" = .{
17+
.url = "git+https://github.com/Syndica/boringssl-zig.git#c53df00d06b02b755ad88bbf4d1202ed9687b096",
18+
.hash = "boringssl-0.1.0-VtJeWehMAAA4RNnwRnzEvKcS9rjsR1QVRw1uJrwXxmVK",
19+
},
1620
},
1721
}

vendor/mbedtls

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)