When building wolfSSL for an embedded system, custom IDE, or other environment where the standard ./configure build system isn’t practical, user_settings.h provides a simple way to manage your wolfSSL configuration in one place.
Instead of passing dozens of compiler definitions to the build system, you can maintain the wolfSSL configuration in a single header file that can be version-controlled alongside your application.
When should I use user_settings.h?<h4<
Use user_settings.h when:
- You are building wolfSSL directly from source.
- You are using an embedded or vendor IDE.
- You need a configuration that is specific to your target hardware.
- You want your wolfSSL configuration checked into your source tree.
- You want to make it easy to reproduce the same wolfSSL configuration across builds.
How does user_settings.h work?
When WOLFSSL_USER_SETTINGS is defined, wolfSSL’s settings.h automatically includes a header named user_settings.h.
Your application should include:
#include <wolfssl/wolfcrypt/settings.h>
before including other wolfSSL headers.
The user_settings.h file must be available through your compiler’s include path.
A typical project therefore looks like:
my-project/ ├── src/ ├── include/ │ └── user_settings.h └── wolfssl/
and the compiler is given include/ as an include directory.
Step 1: Create user_settings.h
Start with the wolfSSL configuration template:
wolfssl/examples/configs/user_settings_template.h
The wolfSSL repository contains several example configurations that can also be used as starting points.
For example:
/* user_settings.h */ #define WOLFSSL_TLS13 #define HAVE_ECC #define HAVE_AESGCM #define HAVE_SHA256
Your actual configuration will depend on the protocols, algorithms, hardware acceleration, operating system, and memory constraints of your application.
Step 2: Define WOLFSSL_USER_SETTINGS
Add:
WOLFSSL_USER_SETTINGS
to the compiler’s preprocessor definitions.
For example, with GCC:
-DWOLFSSL_USER_SETTINGS
Or define it in the project settings of your IDE.
When wolfSSL is compiled, settings.h will then locate and include your user_settings.h.
Step 3: Include settings.h first
Your application should include:
#include <wolfssl/wolfcrypt/settings.h>
before other wolfSSL headers.
For example:
#include <wolfssl/wolfcrypt/settings.h> #include <wolfssl/ssl.h> #include <wolfssl/error-ssl.h>
This ordering is important because the configuration must be established before the other wolfSSL headers are processed.
Why use user_settings.h instead of modifying settings.h?
You generally should not modify wolfSSL’s standard settings.h directly for application-specific configuration.
A separate user_settings.h gives you:
- A single place to maintain your configuration
- Easier upgrades to newer wolfSSL releases
- A configuration that can be kept with your application source
- Easier reproduction of production builds
- Less risk of losing application-specific changes when updating wolfSSL
wolfSSL’s porting guide specifically recommends user_settings.h for custom configurations that are not intended to become part of the standard wolfSSL source tree.
Where can I find example configurations?
The wolfSSL source tree contains several example configurations:
- user_settings_template.h — general configuration template
- user_settings_all.h — enables all available features
- user_settings_min_ecc.h — minimal ECC/SHA-256 configuration
- user_settings_wolfboot_keytools.h — configuration used by wolfBoot key tools
- user_settings_fipsv2.h — FIPS 140-2 configuration
- user_settings_fipsv5.h — FIPS 140-3 development configuration
- user_settings_stm32.h — STM32 configuration example
These files are useful as references, but you should treat them as starting points rather than configurations to copy blindly.
A common mistake: configuring the library and application differently
One of the most common wolfSSL build problems is a mismatch between the configuration used to compile the wolfSSL library and the configuration used by the application.
For example, if the library was compiled with ECC disabled but the application expects ECC APIs to be available, the resulting build can fail or behave unexpectedly.
The application and wolfSSL library need to use the same configuration.
This is one reason maintaining the configuration in a single user_settings.h file is useful. wolfSSL has specifically identified application/library configuration mismatches as a common source of support issues.
Quick troubleshooting checklist
If wolfSSL doesn’t appear to be using your user_settings.h, check these first:
- Is WOLFSSL_USER_SETTINGS defined when compiling the wolfSSL source?
- Is user_settings.h actually on the compiler’s include path?
- Is #include <wolfssl/wolfcrypt/settings.h> included before other wolfSSL headers?
- Are you accidentally using a generated options.h configuration at the same time?
- Are the application and wolfSSL library being compiled with the same configuration?
- Are you linking against a different wolfSSL build than the one you just configured?
If you have questions about any of the above, please contact us at facts@wolfssl.com or call us at +1 425 245 8247.

