diff options
Diffstat (limited to '')
-rw-r--r-- | Dockerfile | 1 | ||||
-rw-r--r-- | docker-compose.yaml | 2 | ||||
-rw-r--r-- | src/main/resources/application.properties | 6 | ||||
-rwxr-xr-x | tests.sh | 8 |
4 files changed, 12 insertions, 5 deletions
@@ -2,6 +2,7 @@ FROM alpine:3.15 as certbuilder RUN apk add openssl WORKDIR /certs RUN openssl req -nodes -new -x509 -subj="/C=US/ST=Denial/L=springfield/O=Dis/CN=localhost" -keyout server.key -out server.cert +RUN openssl pkcs12 -export -out cert.p12 -inkey server.key -in server.cert -password pass:thequicklazybrownfox FROM gradle:7.3.3-jdk11-alpine AS builder WORKDIR /home/springapp diff --git a/docker-compose.yaml b/docker-compose.yaml index dd4939a..b1bb081 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,7 @@ services: build: context: . ports: - - "9080:8080" + - "9080:8443" networks: - springnet cap_drop: diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 357f85a..e40aba9 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -7,3 +7,9 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.format_sql=true server.error.include-message=always +server.http2.enabled=true +server.port=8443 +server.ssl.enabled=true +server.ssl.key-store=/certs/cert.p12 +server.ssl.key-store-type=PKCS12 +server.ssl.key-store-password=thequicklazybrownfox @@ -1,6 +1,6 @@ #!/bin/sh -curl -X POST -H "Content-Type:application/json" -d '{"name":"doc1", "lastModified": 1652882691, "body":"Hello"}' "http://localhost:9080/api/v1/doc" -curl -X GET "http://localhost:9080/api/v1/doc/2" -curl -X DELETE "http://localhost:9080/api/v1/doc/1" -curl -X PUT -H "Content-Type:application/json" -d '{"id": 1, "body": "Die before I do"}' "http://localhost:9080/api/v1/doc/1" +curl -k -X POST -H "Content-Type:application/json" -d '{"name":"doc1", "lastModified": 1652882691, "body":"Hello"}' "https://localhost:9080/api/v1/doc" +curl -k -X GET "https://localhost:9080/api/v1/doc/2" +curl -k -X DELETE "https://localhost:9080/api/v1/doc/1" +curl -k -X PUT -H "Content-Type:application/json" -d '{"id": 1, "body": "Die before I do"}' "https://localhost:9080/api/v1/doc/1" |