diff options
author | Steve Smokowski <ss835w@att.com> | 2019-07-18 18:22:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-07-18 18:22:15 +0000 |
commit | 97ad3ad656f2cdefb9606654b5ceacc12694fddb (patch) | |
tree | a8f229ec38ef766b8fec32c72882fa0276f9d89d /vnfm-simulator | |
parent | 582c5624b4947c14116477297bb4535043281bed (diff) | |
parent | d419c8d0fbfb235234c5a3f01711b1c76a9748bb (diff) |
Merge "Implement TLS for calls from VNFM adapter to VNFM"
Diffstat (limited to 'vnfm-simulator')
5 files changed, 32 insertions, 5 deletions
diff --git a/vnfm-simulator/vnfm-service/pom.xml b/vnfm-simulator/vnfm-service/pom.xml index c09c5f070a..7beccb6561 100644 --- a/vnfm-simulator/vnfm-service/pom.xml +++ b/vnfm-simulator/vnfm-service/pom.xml @@ -144,5 +144,23 @@ <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + <excludes> + <exclude>**/*.p12</exclude> + <exclude>**/*.jks</exclude> + </excludes> + </resource> + <resource> + <directory>src/main/resources</directory> + <filtering>false</filtering> + <includes> + <include>**/*.p12</include> + <include>**/*.jks</include> + </includes> + </resource> + </resources> </build> </project> diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java index 91b79754a5..32c05ebca8 100644 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java +++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java @@ -4,6 +4,7 @@ import java.net.InetAddress; import java.util.Arrays; import org.onap.svnfm.simulator.constants.Constant; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.cache.Cache; @@ -19,6 +20,9 @@ public class ApplicationConfig implements ApplicationRunner { private static final String PORT = "local.server.port"; + @Value("${server.dns.name:so-vnfm-simulator.onap}") + private String serverDnsName; + @Autowired private Environment environment; @@ -26,7 +30,7 @@ public class ApplicationConfig implements ApplicationRunner { @Override public void run(final ApplicationArguments args) throws Exception { - baseUrl = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + environment.getProperty(PORT); + baseUrl = "https://" + serverDnsName + ":" + environment.getProperty(PORT); } public String getBaseUrl() { @@ -35,8 +39,8 @@ public class ApplicationConfig implements ApplicationRunner { @Bean public CacheManager cacheManager() { - Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE); - SimpleCacheManager manager = new SimpleCacheManager(); + final Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE); + final SimpleCacheManager manager = new SimpleCacheManager(); manager.setCaches(Arrays.asList(inlineResponse201)); return manager; } diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java index 9c3a02d4e6..d3ff66aed0 100644 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java +++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java @@ -168,6 +168,6 @@ public class SvnfmController { final HttpHeaders headers = new HttpHeaders(); headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); - return new ResponseEntity<>(response, headers, HttpStatus.OK); + return new ResponseEntity<>(response, headers, HttpStatus.CREATED); } } diff --git a/vnfm-simulator/vnfm-service/src/main/resources/application.yaml b/vnfm-simulator/vnfm-service/src/main/resources/application.yaml index 2ef302ce25..ea8105d891 100644 --- a/vnfm-simulator/vnfm-service/src/main/resources/application.yaml +++ b/vnfm-simulator/vnfm-service/src/main/resources/application.yaml @@ -34,6 +34,11 @@ server: port: 9093 tomcat: max-threads: 50 + ssl: + key-alias: so@so.onap.org + key--store-password: '7Em3&j4.19xYiMelhD5?xbQ.' + key-store: classpath:so-vnfm-simulator.p12 + key-store-type: PKCS12 vnfds: vnfdlist: @@ -56,4 +61,4 @@ vnfds: - vnfcid: VNFC4 resourceTemplateId: vnfd2_vnfc4 vduId: vnfd2_vduForVnfc4 - type: COMPUTE
\ No newline at end of file + type: COMPUTE diff --git a/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12 b/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12 Binary files differnew file mode 100644 index 0000000000..7ac02855bc --- /dev/null +++ b/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12 |