Skip to content

Add wolfssl.skipLibraryLoad System Property Support#325

Open
cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon:skipLoad
Open

Add wolfssl.skipLibraryLoad System Property Support#325
cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon:skipLoad

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Feb 5, 2026

This PR adds a new System property support for wolfssl.skipLibraryLoad to skip automatic System.loadLibrary() calls.

This allows applications to load native libraries manually via System.load() with custom paths, which can be useful for bundling native libraries inside JAR files or doing other application-level library loading management.

Native init() and FIPS CAST still run regardless of skip setting in WolfSSL.java.

Goes along with JCE addition of the same here: wolfSSL/wolfcrypt-jni#189

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for a new wolfssl.skipLibraryLoad system property that allows applications to manually load native libraries instead of relying on the automatic System.loadLibrary() calls. This is useful for scenarios where native libraries are bundled inside JAR files or require custom loading logic.

Changes:

  • Added libraryLoadSkipped static field and isLibraryLoadSkipped() method to track skip state
  • Modified loadLibrary() to check the system property and skip loading when set to "true"
  • Added comprehensive tests for the new functionality
  • Updated documentation with usage examples and explanations

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/java/com/wolfssl/WolfSSL.java Implements the skipLibraryLoad functionality with property checking, state tracking, and API method
src/test/com/wolfssl/test/WolfSSLTest.java Adds three test methods to verify default behavior, property handling, and post-load property changes
README.md Documents the new system property with clear examples for command-line and programmatic usage
native/com_wolfssl_WolfSSLCertificate.h Formatting changes to JNI method declarations (unrelated cleanup)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants