Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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: 2 additions & 0 deletions .github/workflows/ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ jobs:
wolfssl:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
wolfssl:
- { ref: "v5.1.1-stable", name: "5.1.1"}
- { ref: "v5.2.0-stable", name: "5.2.0" }
- { ref: "v5.3.0-stable", name: "5.3.0"}
- { ref: "v5.7.0-stable", name: "5.7.0"}
name: wolfSSL ${{ matrix.wolfssl.name }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,19 @@ target_include_directories(jwt-cpp INTERFACE $<BUILD_INTERFACE:${JWT_INCLUDE_PAT

if(${JWT_SSL_LIBRARY} MATCHES "OpenSSL")
target_link_libraries(jwt-cpp INTERFACE OpenSSL::SSL OpenSSL::Crypto)
target_compile_definitions(jwt-cpp INTERFACE JWT_OPENSSL)
endif()

if(${JWT_SSL_LIBRARY} MATCHES "LibreSSL")
target_link_libraries(jwt-cpp INTERFACE LibreSSL::TLS)
target_compile_definitions(jwt-cpp INTERFACE JWT_LIBRESSL)
endif()

if(${JWT_SSL_LIBRARY} MATCHES "wolfSSL")
target_link_libraries(jwt-cpp INTERFACE PkgConfig::wolfssl)
# This is required to access OpenSSL compatibility API
target_include_directories(jwt-cpp INTERFACE ${wolfssl_INCLUDE_DIRS})
target_compile_definitions(jwt-cpp INTERFACE OPENSSL_EXTRA OPENSSL_ALL)
target_compile_definitions(jwt-cpp INTERFACE JWT_WOLFSSL)
endif()

if(NOT JWT_DISABLE_PICOJSON AND JWT_EXTERNAL_PICOJSON)
Expand Down
4 changes: 4 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ The minimum is `jwt.h` but you will need to add the defines:

- [`JWT_DISABLE_BASE64`](https://github.com/Thalhammer/jwt-cpp/blob/c9a511f436eaa13857336ebeb44dbc5b7860fe01/include/jwt-cpp/jwt.h#L11)
- [`JWT_DISABLE_PICOJSON`](https://github.com/Thalhammer/jwt-cpp/blob/c9a511f436eaa13857336ebeb44dbc5b7860fe01/include/jwt-cpp/jwt.h#L4)
- The SSL library being used needs to be defined:
- `JWT_OPENSSL` for OpenSSL (Default)
- `JWT_LIBRESSL` for LibreSSL
- `JWT_WOLFSSL` for wolfSSL

In addition to providing your own JSON traits implementation, see [traits.md](traits.md) for more information.

Expand Down
5 changes: 5 additions & 0 deletions include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include "base.h"
#endif

#ifdef JWT_WOLFSSL
#include <wolfssl/options.h>
#include <wolfssl/version.h>
#endif
#include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/err.h>
Expand All @@ -20,6 +24,7 @@
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <openssl/ssl.h>
#include <openssl/opensslv.h>

#include <algorithm>
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion tests/HelperTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace {
std::string google_cert =
// This is to handle the different subject alternate name ordering
// see https://github.com/wolfSSL/wolfssl/issues/4397
#ifdef LIBWOLFSSL_VERSION_HEX
#if defined(LIBWOLFSSL_VERSION_HEX) && LIBWOLFSSL_VERSION_HEX < 0x05007000
R"(-----BEGIN CERTIFICATE-----
MIIFfTCCBOagAwIBAgIKYFOB9QABAACIvTANBgkqhkiG9w0BAQUFADBGMQswCQYD
VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu
Expand Down
Loading