mcpp index

compat.openssl

#include

OpenSSL — TLS/crypto library (static, install()-driven build)

#include <openssl/ssl.h>
mcpp add compat.openssl@3.5.1

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// compat.openssl end-to-end: headers resolve, both archives link, and the
// library initialises far enough to stand up a TLS context and run a digest.
//
// Touching BOTH archives is the point: libssl.a (SSL_CTX_new, TLS_method) and
// libcrypto.a (EVP_*) — libssl.lib / libcrypto.lib on Windows. A link that
// silently dropped one, or picked up a host libssl.so instead of the package's
// own static build, fails here.
//
// HAVE_OPENSSL comes from this project's own cfg-gated cxxflags. The package
// is supported on all three platforms now (linux/macOS: perl Configure + GNU
// Make; windows: VC-WIN64A + nmake), so the real test runs everywhere.
#ifdef HAVE_OPENSSL
#include <openssl/ssl.h>
#include <openssl/evp.h>
#include <openssl/opensslv.h>

#include <cstring>

int main() {
    // Built from the 3.5.1 tarball this descriptor pins.
    if (OPENSSL_VERSION_MAJOR != 3 || OPENSSL_VERSION_MINOR != 5) return 1;

// …

tests/examples/openssl/tests/tls.cpp · 專案 tests/examples/openssl

建置

targets
openssl (lib)
language
c++23
C standard
c11
import std
no
include dirs
include

原始檔 (1)

  • mcpp_openssl_anchor.c

版本

版本平台 鏡像sha256
3.5.1 最新 LinuxWindowsmacOS GLOBAL CN 529043b15cff…