From: PatrikBuhr Date: Thu, 11 Aug 2022 07:12:25 +0000 (+0200) Subject: NONRTRIC - new certs, updated springboot version X-Git-Tag: 1.2.0~23 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F8849%2F1;p=nonrtric%2Fplt%2Fdmaapadapter.git NONRTRIC - new certs, updated springboot version Created new certs Updated springboot version Signed-off-by: PatrikBuhr Issue-ID: NONRTRIC-773 Change-Id: Ie9f798cdb147873fcdc4fd4c9bb911d19abc4e49 --- diff --git a/config/README b/config/README index a2137b5..46f0c4a 100644 --- a/config/README +++ b/config/README @@ -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 diff --git a/config/keystore.jks b/config/keystore.jks index 675785b..563c67b 100644 Binary files a/config/keystore.jks and b/config/keystore.jks differ diff --git a/config/truststore.jks b/config/truststore.jks index e883cd6..50a0f9e 100644 Binary files a/config/truststore.jks and b/config/truststore.jks differ diff --git a/src/test/java/org/oran/dmaapadapter/ApplicationTest.java b/src/test/java/org/oran/dmaapadapter/ApplicationTest.java index 85c02b0..b351208 100644 --- a/src/test/java/org/oran/dmaapadapter/ApplicationTest.java +++ b/src/test/java/org/oran/dmaapadapter/ApplicationTest.java @@ -266,6 +266,13 @@ class ApplicationTest { } } + @Test + void testTrustValidation() throws IOException { + String url = "https://localhost:" + applicationConfig.getLocalServerHttpPort() + "/v3/api-docs"; + ResponseEntity resp = restClient(true).getForEntity(url).block(); + assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK); + } + @Test void testResponseCodes() throws Exception { String supervisionUrl = baseUrl() + ProducerCallbacksController.SUPERVISION_URL;