diff --git a/build.gradle b/build.gradle index d310763..d0aea6f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,12 @@ plugins { - id 'com.github.johnrengelman.shadow' version '6.1.0' apply false + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false id 'java' } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +java { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 +} group 'io.sisu' version '1.4.0-SNAPSHOT' @@ -14,8 +16,8 @@ repositories { } dependencies { - implementation 'net.java.dev.jna:jna:5.6.0' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' + implementation 'net.java.dev.jna:jna:5.14.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' } @@ -30,9 +32,10 @@ task getVersion { project(':benchmarks') { apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java' - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - + java { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } group = 'io.sisu.nng' version = parent.version @@ -42,7 +45,7 @@ project(':benchmarks') { dependencies { implementation rootProject - implementation 'net.java.dev.jna:jna:5.6.0' + implementation 'net.java.dev.jna:jna:5.14.0' } jar { @@ -55,9 +58,10 @@ project(':benchmarks') { project(':demo') { apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java' - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - + java { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } group = 'io.sisu.nng' version = parent.version @@ -75,6 +79,7 @@ project(':demo') { } } + /* task runDemoAsyncServer(type: JavaExec) { group = "Execution" description = "Run the Async Server demo" @@ -90,4 +95,5 @@ project(':demo') { main = $/io.sisu.nng.demo.async.Client/$ environment "JNA_LIBRARY_PATH", System.getenv("JNA_LIBRARY_PATH") } + */ } \ No newline at end of file diff --git a/src/main/java/io/sisu/nng/TlsConfig.java b/src/main/java/io/sisu/nng/TlsConfig.java index 007fbc4..ca2dc05 100644 --- a/src/main/java/io/sisu/nng/TlsConfig.java +++ b/src/main/java/io/sisu/nng/TlsConfig.java @@ -66,6 +66,7 @@ public UInt16 getValue() { } public TlsConfig(SocketMode mode) throws NngException { + Nng.lib().nng_tls_register(); TlsConfigByReference ref = new TlsConfigByReference(); int rv = Nng.lib().nng_tls_config_alloc(ref, mode.getValue()); if (rv != 0) { @@ -76,6 +77,13 @@ public TlsConfig(SocketMode mode) throws NngException { this.socketMode = mode; } + void setCertificateAuthorityFile(String path) throws NngException { + int rv = Nng.lib().nng_tls_config_ca_file(this.tls, path); + if (rv != 0) { + throw new NngException(Nng.lib().nng_strerror(rv)); + } + } + void setAuthMode(AuthMode authMode) throws NngException { int rv = Nng.lib().nng_tls_config_auth_mode(this.tls, authMode.value); if (rv != 0) { diff --git a/src/main/java/io/sisu/nng/internal/NngDirectLibrary.java b/src/main/java/io/sisu/nng/internal/NngDirectLibrary.java index 31be02e..6d0ceac 100644 --- a/src/main/java/io/sisu/nng/internal/NngDirectLibrary.java +++ b/src/main/java/io/sisu/nng/internal/NngDirectLibrary.java @@ -301,6 +301,8 @@ public native int nng_http_handler_alloc_static(HttpHandlerPointerByReference ha public native String nng_tls_engine_description(); public native boolean nng_tls_engine_fips_mode(); public native String nng_tls_engine_name(); + public native int nng_tls_register(); + // XXX: Memtrack...requires patch to NNG that tracks memory allocation // public native int nng_memtrack(UInt64ByReference alloc, UInt64ByReference freed); } diff --git a/src/main/java/io/sisu/nng/internal/NngLibrary.java b/src/main/java/io/sisu/nng/internal/NngLibrary.java index cfae175..6f6da4e 100644 --- a/src/main/java/io/sisu/nng/internal/NngLibrary.java +++ b/src/main/java/io/sisu/nng/internal/NngLibrary.java @@ -285,6 +285,7 @@ int nng_http_handler_alloc_static(HttpHandlerPointerByReference handlerRef, Stri String nng_tls_engine_description(); boolean nng_tls_engine_fips_mode(); String nng_tls_engine_name(); + int nng_tls_register(); // XXX Memtrack...requires patch for NNG to track memory allocation // int nng_memtrack(UInt64ByReference alloc, UInt64ByReference freed); diff --git a/src/test/java/io/sisu/nng/TlsTest.java b/src/test/java/io/sisu/nng/TlsTest.java index 23b4689..2473344 100644 --- a/src/test/java/io/sisu/nng/TlsTest.java +++ b/src/test/java/io/sisu/nng/TlsTest.java @@ -8,6 +8,7 @@ import java.io.BufferedReader; import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.nio.ByteBuffer; import java.nio.CharBuffer; @@ -41,13 +42,18 @@ public static void setup() throws Exception { @Test - public void simpleTlsSetupTest() throws NngException { + public void simpleTlsSetupTest() throws NngException, FileNotFoundException { Socket client = new Req0Socket(); Socket server = new Rep0Socket(); TlsConfig clientConfig = new TlsConfig(TlsConfig.SocketMode.CLIENT); clientConfig.setAuthMode(TlsConfig.AuthMode.NONE); - // clientConfig.setServerName("localhost"); + clientConfig.setServerName("localhost"); + final String ca = TlsTest.class.getResource(certFilename).getPath(); + if (ca == null) { + throw new FileNotFoundException("could not get path to CA certicate"); + } + clientConfig.setCertificateAuthorityFile(ca); client.setTlsConfig(clientConfig); TlsConfig serverConfig = new TlsConfig(TlsConfig.SocketMode.SERVER); @@ -55,6 +61,7 @@ public void simpleTlsSetupTest() throws NngException { server.setTlsConfig(serverConfig); server.listen("tls+tcp://localhost:9999"); + //try {Thread.sleep(120 * 1000); } catch (InterruptedException e) {} client.dial("tls+tcp://localhost:9999"); Message msg = new Message(); diff --git a/src/test/resources/cert.crt b/src/test/resources/cert.crt index 7a047f5..a8949a8 100644 --- a/src/test/resources/cert.crt +++ b/src/test/resources/cert.crt @@ -1,20 +1,33 @@ -----BEGIN CERTIFICATE----- -MIIDQjCCAioCCQDgiYAu4khx8zANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJY -WDEPMA0GA1UECAwGVXRvcGlhMRYwFAYDVQQHDA1QYXJhZGlzZSBDaXR5MRcwFQYD -VQQKDA5OTkcgSmF2YSwgSW5jLjESMBAGA1UEAwwJbG9jYWxob3N0MB4XDT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kY8OzAfBgNVHSMEGDAWgBTqjvmxTRgmJ6/SpMVUbaSttkY8OzAPBgNVHRMB +Af8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4ICAQAx6UcCNjtLmyuJZaxbEyALR1F5 +7vOrh/mh/iGF45b3mR3CggwFYPkjJ2BOOqJP9koevIIHn4dTrpoUldTCicFWOibq +fUZCYUqk+LKiWP87zUQNwZR10l1XEWWyDzNzA/fNSuhPuv5V5wSXno1f97+Cyo7+ +mnvcHsDYEwiSdP7EVmYsE9mux0gJ4aUD2VFOl3lv37CR27QrqzwGA9YAyRVNQfeH +TDTvHCCFf0w3beSHCisPFGuldZWcUQf9CLX7l7879WHT3z3U7H2MGQRBsR9Z+SXE +ZsNKAcmFFb9tLrQjmYwHedbkPpPX1+mWq61GQ496ZJbHGUezAzpAsltbyrASZkR5 +MfPg+AYH2830fyTfIeXsRWY3oZk75GE8SSS7mD1RtpsK16zPPlNyp0barS2CkNI1 +dLpvZyo7q7CvJa69kdJJR2FTtTBH8Vmb+z3ehdH8ljstN/gbOiNOqlhTzeBW+XP7 +j02M5EON/zOjuYhYLriTEBJIic2jZwrHHjXLF0hrIveBNHksvqS4HLHvMPWFuqOR +1ZWZDdsJTQcvh5PzjZG80ois9rinP7ppZQzTkKUC+wMVd+C2qmFcInz6WJwzUUkL +y3e637GxyMTEalzZtDjcLedaVnAHDrcEZUFeyWMCFsMVE2AjWdUq2BE1rBJwKz/h +j8ezEoRiggx5aUmk3w== -----END CERTIFICATE----- diff --git a/src/test/resources/key.key b/src/test/resources/key.key index 7c63099..2350a70 100644 --- a/src/test/resources/key.key +++ b/src/test/resources/key.key @@ -1,27 +1,52 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAzuZ4Ax0xMyYGSEL5JEypd5RYO1/tlvF29cugcMhazVT3lTdG -w0SeFZ3Pn99pXFQxPH9stPKEYZyhVHkpDyohGCAVE6MDTm+D7LpHkwZI8VOVBS2j -g4g5RGQroz0TCtqKc5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PJXYCBTgggmtpzu20SjPjYrSUQDcSljLPUN6og691+UdHILy7 +AQKCAQEAzZy9DDgtj3CqcaBXdRQhtxegSx+VATm+IV1aMnHoPbfzVyBLA1NjUioG +w8+5JcomCY9ePCUinAEIufiGJdH//XVFGwFoVk+jRYcSbHiK+0jup0JbBjd9u2pz +mFIkmQjjMNMQsXf/ueXhbRB8GEvNfCrQTl2U2jQmApJBKFKDw04IWOCptbYu3X2e +bcaHI0c2x5Th4G+tLh0WPxWERlLoud+TkxWwFxHqL36Vj7fERxNFwTsC+y1Qnj81 +WinglnkRTzj/HTZyOOPvEpiZ7KpTjak8l8AJZTvaF/pLr64vJGO+B330WI2DJvaI +rvuqegRRCZZoZg+lqn2nVAcMEgiLIg== +-----END PRIVATE KEY----- diff --git a/src/test/resources/regen.sh b/src/test/resources/regen.sh new file mode 100755 index 0000000..5ef2ab7 --- /dev/null +++ b/src/test/resources/regen.sh @@ -0,0 +1,6 @@ +#!/bin/sh +rm key.key cert.crt +openssl req -x509 -newkey rsa:4096 -keyout key.key -out cert.crt \ + -sha256 -days 3650 -nodes \ + -subj "/C=US/ST=Vermont/L=Burlington/O=NA/OU=junk/CN=localhost" +chmod 0400 key.key cert.crt \ No newline at end of file