Question: I am working on spring web app using maven. I am trying to make localhost a secure connection.I am using tomcat server. I used this [link](http://docs.oracle.com/cd/E19798-01/821-1841/bnbyb/index.html) for creating my own CA and added it to JVM.
This is what I added in pom.xml.

```
<plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <path>/security</path>
            <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="200" scheme="https" secure="true" keystoreFile="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64/jre/lib/security/cacerts.jks" keystorePass="security"
           clientAuth="false" sslProtocol="TLS" />

        </configuration>
</plugin>

```

I went to the link:<https://localhost:8443> . But no app is running on that port. Could someone please help?

Answer: 
Go to sever.xml and add following xml

```
 <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" 
maxThreads="150" SSLEnabled="true" scheme="https" secure="true" 
clientAuth="false" sslProtocol="TLS" keystoreFile="{path}/mycer.cert" keystorePass="{password}"/>
     <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

```

1. first you want to create one CA certificate
2. you can use java key tool for certificate creation
3. store that certificate on your server .
4. add connector config with in your tomcat server.xml
5. you should provide certificate path and password that given
6. restart server

if any problem for restarting comment stack trace 

<http://www.mkyong.com/tomcat/how-to-configure-tomcat-to-support-ssl-or-https/>
You need to add a connector in `servlet.xml` file. 

```
<Connector
           protocol="org.apache.coyote.http11.Http11Protocol"
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="${user.home}/.keystore" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS"/>

```

Replace the keystore file path and the password with the ones you have.

Refer <https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html>.