diff --git a/pom.xml b/pom.xml
index c455b7a8d519792b5f1c14e356a390678efd4ce5..ef7a01f3962142dcea4f5cb326a2efd9b15a3cc4 100755
--- a/pom.xml
+++ b/pom.xml
@@ -156,9 +156,20 @@
${lombok.version}
-
-
-
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5
+
+
+ org.postgresql
+ postgresql
+ runtime
+
+
+ org.flywaydb
+ flyway-core
+
diff --git a/src/main/java/org/edgegallery/mecm/appo/AppOrchestratorApplication.java b/src/main/java/org/edgegallery/mecm/appo/AppOrchestratorApplication.java
index 5dce29e2f73dfbdc95a0f1c71843fa141cbcd60f..96af184fb97ad642a25e6c87bb111c2aa9cb8efb 100755
--- a/src/main/java/org/edgegallery/mecm/appo/AppOrchestratorApplication.java
+++ b/src/main/java/org/edgegallery/mecm/appo/AppOrchestratorApplication.java
@@ -16,6 +16,14 @@
package org.edgegallery.mecm.appo;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
@@ -37,9 +45,36 @@ public class AppOrchestratorApplication {
* @param args arguments
*/
public static void main(String[] args) {
- // TODO: Token & https based support.
+
logger.info("Edge application orchestrator starting----");
- SpringApplication.run(AppOrchestratorApplication.class, args);
+
+ // do not check host name
+ TrustManager[] trustAllCerts = new TrustManager[]{
+ new X509TrustManager() {
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ logger.info("checks client trusted");
+ }
+
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ logger.info("checks server trusted");
+ }
+ }
+ };
+ SSLContext sc = null;
+ try {
+ sc = SSLContext.getInstance("TLSv1.2");
+ sc.init(null, trustAllCerts, new java.security.SecureRandom());
+ HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+ HttpsURLConnection.setDefaultHostnameVerifier(NoopHostnameVerifier.INSTANCE);
+
+ SpringApplication.run(AppOrchestratorApplication.class, args);
+ } catch (KeyManagementException | NoSuchAlgorithmException e) {
+ logger.info("SSL context init error... exiting system {}", e.getMessage());
+ }
}
}
diff --git a/src/main/java/org/edgegallery/mecm/appo/apihandler/AppOrchestratorHandler.java b/src/main/java/org/edgegallery/mecm/appo/apihandler/AppOrchestratorHandler.java
index 11d2ec14d75707fa85b270f28692897acf60f97f..9df3fe60aec99780aacdd16e9b734d9e14d108e2 100644
--- a/src/main/java/org/edgegallery/mecm/appo/apihandler/AppOrchestratorHandler.java
+++ b/src/main/java/org/edgegallery/mecm/appo/apihandler/AppOrchestratorHandler.java
@@ -72,14 +72,14 @@ public class AppOrchestratorHandler {
@ApiOperation(value = "Creates application instance", response = Map.class)
@PostMapping(path = "/tenants/{tenant_id}/app_instances", produces = MediaType.APPLICATION_JSON_VALUE)
@ApiResponses(value = {@ApiResponse(code = 201, message = "request accepted ", response = String.class),
- @ApiResponse(code = 500, message = "internal server error", response = String.class)
+ @ApiResponse(code = 500, message = "internal server error", response = String.class)
})
public ResponseEntity