Skip to content

allyourcodebase/boringssl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BoringSSL

This is BoringSSL, packaged for Zig.

Installation

First, update your build.zig.zon:

# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save git+https://github.com/lukaskastern/boringssl.git

You can then import boringssl in your build.zig with:

const boringssl_dependency = b.dependency("boringssl", .{
    .target = target,
    .optimize = optimize,
});
your_exe.linkLibrary(boringssl_dependency.artifact("bcm"));
your_exe.linkLibrary(boringssl_dependency.artifact("ssl"));
your_exe.linkLibrary(boringssl_dependency.artifact("crypto"));

And use the library like this:

const ssl = @cImport({
    @cInclude("openssl/ssl.h");
});

const ctx = ssl.EVP_CIPHER_CTX_new();
...
...

Notes

Windows support:

At the moment only x86_64-windows-gnu is functional. MSVC doesn't work!

GNU doesn't seem an official target by boringssl for windows which is why we need the patch.

Zig Version

The target zig version is 0.16.0

About

boringssl packaged with Zig

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages