NONRTRIC - new certs, updated springboot version 49/8849/1
authorPatrikBuhr <patrik.buhr@est.tech>
Thu, 11 Aug 2022 07:12:25 +0000 (09:12 +0200)
committerPatrikBuhr <patrik.buhr@est.tech>
Thu, 11 Aug 2022 07:12:25 +0000 (09:12 +0200)
Created new certs
Updated springboot version

Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-773
Change-Id: Ie9f798cdb147873fcdc4fd4c9bb911d19abc4e49

config/README
config/keystore.jks
config/truststore.jks
src/test/java/org/oran/dmaapadapter/ApplicationTest.java

index a2137b5..46f0c4a 100644 (file)
@@ -3,10 +3,12 @@ The keystore.jks and truststore.jks files are created by using the following com
 1) Create a CA certificate and a private key:
 
 openssl genrsa -des3 -out CA-key.pem 2048
-openssl req -new -key CA-key.pem -x509 -days 1000 -out CA-cert.pem
+openssl req -new -key CA-key.pem -x509 -days 3600 -out CA-cert.pem
 
 2) Create a keystore with a private key entry that is signed by the CA:
 
+Note: your name must be "localhost" for the unittest.
+
 keytool -genkeypair -alias policy_agent -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 3650 -storepass policy_agent
 keytool -certreq -alias policy_agent -file request.csr -keystore keystore.jks -ext san=dns:your.domain.com -storepass policy_agent
 openssl x509 -req -days 365 -in request.csr -CA CA-cert.pem -CAkey CA-key.pem -CAcreateserial -out ca_signed-cert.pem
index 675785b..563c67b 100644 (file)
Binary files a/config/keystore.jks and b/config/keystore.jks differ
index e883cd6..50a0f9e 100644 (file)
Binary files a/config/truststore.jks and b/config/truststore.jks differ
index 85c02b0..b351208 100644 (file)
@@ -266,6 +266,13 @@ class ApplicationTest {
         }
     }
 
+    @Test
+    void testTrustValidation() throws IOException {
+        String url = "https://localhost:" + applicationConfig.getLocalServerHttpPort() + "/v3/api-docs";
+        ResponseEntity<String> resp = restClient(true).getForEntity(url).block();
+        assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
+    }
+
     @Test
     void testResponseCodes() throws Exception {
         String supervisionUrl = baseUrl() + ProducerCallbacksController.SUPERVISION_URL;