Deploy a Springboot API (JAR) to an HTTPS Host

Asked

Viewed 173 times

1

I am having a problem deploying a JAR on a VPS (Hostgator) server. The front (angular) deploy was successful. However, I built a test API (Helloworld). In application.properties I put the following settings:

server.port=9443
server.ssl.keyStoreType=JKS
server.ssl.key-store=classpath:Keystore.jks
server.ssl.key-store-password=*****

I managed the jar with mvn clean install and created a folder in /home/user/ea-tomcat85/webapps/api and put the jar in that folder. I executed the command: java -Dspring.profiles.active=Prod -jar *.jar

Application starts at port 9443:

Api iniciada

Even this, all right, however, when running a test with the 'Curl' command with the -v option (https://meusite.com.br:9443/test), a message on the console informs that the certificate is invalid:

Erro certificado inválido

If I put the -k option, it works though in 'unsafe' mode'.

My server is a VPS that is already enabled https with certificate.

Questions:
1) Being my https host, I need to configure properties by enabling https?
2) If yes, what are the steps to deploy a Jar on an https host?
3) I need to configure a Sign self even though my domain already has a valid certificate?

From now on , I appreciate the help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.