Skip to content

Commit da1fac2

Browse files
authored
Merge pull request #249 from cconlon/jniUpdate
Update wolfSSL JNI/JSSE manual and update copyright to 2026
2 parents abc254f + 0d65c7c commit da1fac2

7 files changed

Lines changed: 69 additions & 14 deletions

File tree

wolfSSL-JNI/header.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ header-includes:
88
# Fancy page headers
99
- \usepackage{fancyhdr}
1010
- \pagestyle{fancy}
11-
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2024 wolfSSL Inc.}
11+
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2026 wolfSSL Inc.}
1212
# Wrap long syntax highlighting code blocks
1313
- \usepackage{fvextra}
1414
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}

wolfSSL-JNI/src/chapter03.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ JNI C source files into a shared library for either Unix/Linux or Mac OSX.
1313
This script tries to auto-detect between OSX (Darwin) and Linux to set up
1414
include paths and shared library extension type. This script directly calls gcc
1515
on the JNI C source files, producing `./lib/libwolfssljni.so` or
16-
`./lib/libwolfssljni.jnilib`.
16+
`./lib/libwolfssljni.dylib`.
1717

1818
```
1919
$ ./java.sh
@@ -51,7 +51,7 @@ Preset `CFLAGS` can be passed to the script via the environment:
5151
$ CFLAGS="-DWOLFJNI_USE_IO_SELECT" ./java.sh
5252
```
5353

54-
On Aarch64 hosts, `-fPIC` is automatically added to CFLAGS.
54+
On x86_64 and Aarch64 Linux hosts, `-fPIC` is automatically added to CFLAGS.
5555

5656
## Building with ant
5757

@@ -300,14 +300,14 @@ from `src/java`. This will be the following packages:
300300
```
301301
com.wolfssl
302302
com.wolfssl.provider.jsse
303-
com.wolfssl.wolfcrypt
303+
com.wolfssl.provider.jsse.adapter
304304
```
305305

306306
Run java.sh from the command line or have the IDE execute `java.sh` to generate
307307
the native shim layer linking against wolfSSL.
308308

309309
Add native library reference to the project. It should look in the lib
310-
directory for libwolfssl.jnilib (i.e. wolfssljni/lib/).
310+
directory for libwolfssljni.so or libwolfssljni.dylib (i.e. wolfssljni/lib/).
311311

312312
To compile test cases add the packages `com.wolfssl.provider.jsse.test` and
313313
`com.wolfssl.test` from the directory `src/test`. The project will also need

wolfSSL-JNI/src/chapter04.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,27 @@ applications should register the provider directly using
8787

8888
To install the wolfJSSE provider at the system/OS level, copy the `wolfssl.jar`
8989
and/or `wolfssl-jsse.jar` into the correct Java installation directory for your
90-
OS and verify the `libwolfssljni.so` or `libwolfssljni.jnilib` shared library
90+
OS and verify the `libwolfssljni.so` or `libwolfssljni.dylib` shared library
9191
is on your library search path.
9292

9393
Add the JAR files (`wolfssl.jar`, `wolfssl-jsse.jar`) and shared library
94-
(`libwolfssljni.so`) to the following directory:
94+
(`libwolfssljni.so` or `libwolfssljni.dylib`) to the following directory.
95+
96+
For **JDK 8**:
9597

9698
```
9799
$JAVA_HOME/jre/lib/ext
98100
```
99101

100-
On Ubuntu with OpenJDK this path may be similar to:
102+
On Ubuntu with OpenJDK 8 this path may be similar to:
101103

102104
```
103105
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext
104106
```
105107

108+
**Note:** The `jre/lib/ext` extension mechanism was removed in JDK 9. For
109+
JDK 9 and newer, place the JAR files on the classpath or module path instead.
110+
106111
Next, add an entry to the `java.security` file similar to the following:
107112

108113
```
@@ -111,8 +116,16 @@ security.provider.N=com.wolfssl.provider.jsse.WolfSSLProvider
111116

112117
The java.security file will be located at:
113118

119+
For **JDK 8**:
120+
121+
```
122+
$JAVA_HOME/jre/lib/security/java.security
123+
```
124+
125+
For **JDK 9+**:
126+
114127
```
115-
$JAVA_HOME /jre/lib/security/java.security
128+
$JAVA_HOME/conf/security/java.security
116129
```
117130

118131
Replacing “N” with the order of priority you would like wolfJSSE to have in

wolfSSL-JNI/src/chapter05.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ classes.
4242
Once wolfSSL JNI and wolfJSSE have been compiled, there are two JAR files and
4343
one native shared library that have been generated. These are located in the
4444
`./lib` directory. The native shared library could also be named
45-
`libwolfssljni.jnilib` depending on the operating system.
45+
`libwolfssljni.dylib` depending on the operating system.
4646

4747
```
4848
lib/
49-
libwolfSSL.so (Native C JNI wrapper shared library)
49+
libwolfssljni.so (Native C JNI wrapper shared library)
5050
wolfssl.jar (JAR with ONLY wolfSSL JNI Java classes)
5151
wolfssl-jsse.jar (JAR with BOTH wolfSSL JNI and wolfJSSE classes)
5252
```

wolfSSL-JNI/src/chapter06.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ wolfJSSE extends or implements the following JSSE classes:
2121
javax.security.cert.X509Certificate
2222

2323
**Note:** `DTLSv1.3` is only supported through the `SSLEngine` interface.
24+
DTLSv1.0 and DTLSv1.2 are available through the lower-level wolfSSL JNI API
25+
but are not currently registered as JSSE SSLContext types.
2426

2527
## Secure Renegotiation
2628

wolfSSL-JNI/src/chapter07.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ The following Security properties are specific to wolfJSSE:
4444
| `wolfjsse.keystore.type.required` | | Require specific KeyStore type |
4545
| `wolfjsse.clientSessionCache.disabled` | "false" | Disable client session cache |
4646
| `wolfjsse.X509KeyManager.disableCache` | "false" | Disable X509KeyManager caching |
47+
| `wolfssl.readWriteByteBufferPool.disabled` | "false" | Disable direct ByteBuffer pool for read/write |
48+
| `wolfssl.readWriteByteBufferPool.size` | | Set max number of ByteBuffers in per-thread pool |
49+
| `wolfssl.readWriteByteBufferPool.bufferSize` | | Set size of individual ByteBuffers in pool |
4750

4851
Example cipher suite restriction:
4952

@@ -80,10 +83,14 @@ The following standard Java System properties are supported by wolfJSSE:
8083
| `javax.net.ssl.trustStore` | KeyStore file for TrustManager |
8184
| `javax.net.ssl.trustStoreType` | KeyStore type for TrustManager |
8285
| `javax.net.ssl.trustStorePassword` | KeyStore password for TrustManager |
83-
| `jdk.tls.client.enableSessionTicketExtension` | Enable session tickets (Java 13+) |
86+
| `jdk.tls.client.enableSessionTicketExtension` | Enable client session tickets (Java 13+) |
87+
| `jdk.tls.server.enableSessionTicketExtension` | Enable server session tickets (Java 13+, client-side only currently) |
8488
| `jdk.tls.client.SignatureSchemes` | Client signature algorithms (partial support) |
8589
| `jdk.tls.server.SignatureSchemes` | Server signature algorithms (partial support) |
8690
| `jdk.tls.useExtendedMasterSecret` | Enable/disable Extended Master Secret |
91+
| `jdk.tls.ephemeralDHKeySize` | Control ephemeral DH key size |
92+
| `jdk.tls.trustNameService` | Enable reverse DNS lookup for hostname verification |
93+
| `jsse.enableSNIExtension` | Enable/disable SNI extension (default: true) |
8794

8895
### wolfJSSE-Specific System Properties
8996

@@ -97,7 +104,7 @@ wolfJSSE supports several System properties:
97104
| `wolfjsse.debugFormat` | | "JSON" | Output debug logs in JSON format |
98105
| `wolfsslengine.debug` | "false" | "true" | SSLEngine debug logging |
99106
| `wolfsslengine.io.debug` | "false" | "true" | SSLEngine I/O bytes logging |
100-
| `wolfjsse.autoSNI` | "false" | Auto-set SNI from hostname |
107+
| `wolfjsse.autoSNI` | "false" | "true" | Auto-set SNI from hostname |
101108

102109
## Debugging
103110

@@ -167,7 +174,7 @@ params.setServerNames(Arrays.asList(new SNIHostName("example.com")));
167174
sslSocket.setSSLParameters(params);
168175
```
169176

170-
The `wolfjsse.autoSNI` Security property can enable automatic SNI configuration
177+
The `wolfjsse.autoSNI` System property can enable automatic SNI configuration
171178
from the hostname for `HttpsURLConnection`.
172179

173180
On the server, `SSLSession.getRequestedServerNames()` returns the SNI requested

wolfSSL-JNI/src/chapter08.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,35 @@ argument:
4949
$ ./examples/server.sh --help
5050
```
5151

52+
## SimpleThreadedClient.java and SimpleThreadedServer.java
53+
54+
Multi-threaded JNI client and server examples. These demonstrate using the
55+
wolfSSL JNI wrapper in a multi-threaded environment.
56+
57+
```
58+
$ ./examples/SimpleThreadedServer.sh
59+
$ ./examples/SimpleThreadedClient.sh
60+
```
61+
62+
## X509v3CertificateGeneration.java
63+
64+
Example application demonstrating X.509v3 certificate generation using the
65+
wolfSSL JNI `WolfSSLCertificate` API. Shows how to programmatically create
66+
and sign X.509v3 certificates.
67+
68+
```
69+
$ ./examples/X509v3CertificateGeneration.sh
70+
```
71+
72+
## X509CertRequest.java
73+
74+
Example application demonstrating X.509 Certificate Signing Request (CSR)
75+
generation using the wolfSSL JNI `WolfSSLCertRequest` API.
76+
77+
```
78+
$ ./examples/X509CertRequest.sh
79+
```
80+
5281
# wolfJSSE Provider Examples
5382

5483
The `examples/provider` directory contains examples for the wolfSSL JSSE
@@ -217,6 +246,10 @@ Method Invocation implementation in wolfJSSE.
217246

218247
**RmiClient.java** - Example client, gets an object stub from the remote registry, and makes remote method invocations including `getMessage()`, `sendMessage()`, `getByteArray()`, `sendByteArray()`, and `getRegistryPorts()`. Supports multiple concurrent client connections.
219248

249+
**RmiRemoteInterface.java** - Remote interface definition that both the server and client use.
250+
251+
**RmiTLSClientSocketFactory.java** / **RmiTLSServerSocketFactory.java** - Custom TLS socket factory implementations for RMI, using wolfJSSE for the underlying SSL/TLS connections.
252+
220253
Start the server and client:
221254
```
222255
$ ./examples/provider/rmi/RmiServer.sh

0 commit comments

Comments
 (0)