Skip to content

Dependency on system OpenSSL headers #13

Closed

Description

@psznm

When I compile and use this according to README, I require to have OpenSSL headers on my system. This is also issue because
some macros have been changed to functions by BoringSSL and the generated zig function is wrong.
For example this OpenSSL definition

# define SSL_set_tlsext_host_name(s,name) \
        SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,\
                (void *)name)

gets compiles by translateC to

pub inline fn SSL_set_tlsext_host_name(s: anytype, name: anytype) @TypeOf(SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, __helpers.cast(?*anyopaque, name))) {
    _ = &s;
    _ = &name;
    return SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, __helpers.cast(?*anyopaque, name));
}

However symbol SSL_ctrl is not provided by BoringSSL.

Correct BoringSSL definition is

OPENSSL_EXPORT int SSL_set_tlsext_host_name(SSL *ssl, const char *name);

which should correctly be compiled by translateC to extern symbol.


Another issue is that the new BoringSSL functions are missing. For example SSL_CTX_set_select_certificate_cb is not present in zig file at all.


I have tried ensuring that no system headers are used (by removing /usr/include/openssl) and gotten error error: 'openssl/ssl.h' not found. So then I tried adding boringssl headers lib_ssl_c.addIncludePath(boringssl_dependency.artifact("ssl").getEmittedIncludeTree()); . But this resulted in many compilation errors.

Activity

  1. changed the title [-]Dependency on system headers[/-] [+]Dependency on system OpenSSL headers[/+] on Aug 13, 2026
  2. psznm commented on Aug 13, 2026

    @psznm
    Author

    I also noticed this was fixed on branch 0.16-adjustments (minus info in README)

  3. LukasKastern commented on Aug 13, 2026

    @LukasKastern
    Collaborator

    Hey @psznm! Thanks for reporting this.

    The changes in 0.16-adjustments should do the trick.

    I've just opened #14 which includes those commits and should document the proper usage.
    Let me know if that resolves it for you!

  4. psznm commented on Aug 13, 2026

    @psznm
    Author

    Hey @psznm! Thanks for reporting this.

    The changes in 0.16-adjustments should do the trick.

    I've just opened #14 which includes those commits and should document the proper usage. Let me know if that resolves it for you!

    Yes it does, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions