aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-02-18 16:37:12 +0200
committerZhongheng Liu <z.liu@outlook.com.gr>2024-02-18 16:37:12 +0200
commitdb4308dd29cb3b9b9686cf95c490e7fe108e055b (patch)
treeef3ac00c632ecec64c23b27b52525e04650a8286
parent0d82b9feb36c1492209bd4d75d6c22e009e00770 (diff)
downloadepq-api-db4308dd29cb3b9b9686cf95c490e7fe108e055b.tar.gz
epq-api-db4308dd29cb3b9b9686cf95c490e7fe108e055b.tar.bz2
epq-api-db4308dd29cb3b9b9686cf95c490e7fe108e055b.zip
Added server-side additional code to support HTTPS protocol with self-signed cert
-rw-r--r--pom.xml14
-rw-r--r--src/main/java/me/imsonmia/epqapi/EpqapiApplication.java4
-rw-r--r--src/main/resources/application.properties8
-rw-r--r--src/main/resources/key/cert.p12bin0 -> 4403 bytes
4 files changed, 25 insertions, 1 deletions
diff --git a/pom.xml b/pom.xml
index 104015f..14b8bb3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,7 +50,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
- </dependencies>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ <version>4.4.11</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.9</version>
+ </dependency>
+ </dependencies>
<build>
<plugins>
diff --git a/src/main/java/me/imsonmia/epqapi/EpqapiApplication.java b/src/main/java/me/imsonmia/epqapi/EpqapiApplication.java
index d4ef329..4896604 100644
--- a/src/main/java/me/imsonmia/epqapi/EpqapiApplication.java
+++ b/src/main/java/me/imsonmia/epqapi/EpqapiApplication.java
@@ -1,10 +1,14 @@
package me.imsonmia.epqapi;
+import javax.net.ssl.SSLContext;
+
+import org.apache.tomcat.jni.SSL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
+import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 11ba37c..8118b59 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -13,3 +13,11 @@ spring.jpa.show-sql: true
# validate for semi-production
# none for serious prod scenarios
spring.jpa.hibernate.ddl-auto=update
+
+server.ssl.key-store-type=PKCS12
+server.ssl.key-store=classpath:key/cert.p12
+server.ssl.key-store-password=epqchat
+server.ssl.enabled=true
+
+trust.store=classpath:key/cert.p12
+trust.store.password=epqchat \ No newline at end of file
diff --git a/src/main/resources/key/cert.p12 b/src/main/resources/key/cert.p12
new file mode 100644
index 0000000..27bf3b9
--- /dev/null
+++ b/src/main/resources/key/cert.p12
Binary files differ