You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Joby J. Joseph" <jj...@bankboubyan.com> on 2015/07/12 11:23:19 UTC

Setting SSL in Tomcat 7.0

Hi,

I need a help for setting up the SSL in Tomcat Server 7.0.

I have created keystore and changed the server.xml file. But, I am getting the following exception.

Screen for creating the keystore.

[cid:image001.jpg@01D0BC9D.88D0B150]

After this, I did a listing for the keystore values. It shows an error.

keytool -list -keystore .keystore

and it gives..
keytool error: java.lang.Exception: Keystore file does not exist: .keystore

Any suggestion this error.
Where is the keystore file located.


Thanks in advance...



     Joby J. Joseph
     Systems Engineer -  Application Support


**************************************************************************************
This message contains confidential information and is intended for the use of the addressee only. If you are not the intended recipient of this communication, please delete it immediately, do not copy, distribute or otherwise share this information, and notify the sender promptly.

Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the Bank. The Bank does not endorse or accept responsibility for such views and opinions and accordingly, they are not legally binding on the Bank.

WARNING: Although the Bank has taken reasonable precautions to ensure no viruses are present in this e-mail, the Bank cannot accept responsibility for any loss or damage arising from the use of this e-mail or its attachments and shall not be liable for the e-mail content transmitted over the Internet.
*********************************************

Re: Setting SSL in Tomcat 7.0

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Joby,

On 7/12/15 4:42 AM, Joby J. Joseph wrote:
> <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" 
> port="8443" maxThreads="200" scheme="https" secure="true"
> SSLEnabled="true" keystoreFile="${user.home}/.keystore"
> keystorePass="changeit" clientAuth="false" sslProtocol="TLS"/>

Okay.

> Here. I got the error as...
> 
> SEVERE: Failed to load keystore type JKS with path
> C:\Windows\system32\config\systemprofile/.keystore due to
> C:\Windows\system32\config\systemprofile\.keystore (The system
> cannot find the file specified) java.io.FileNotFoundException:
> C:\Windows\system32\config\systemprofile\.keystore (The system
> cannot find the file specified) at
> java.io.FileInputStream.open(Native Method) at
> java.io.FileInputStream.<init>(Unknown Source)

Your keystore isn't where you think it is. What did you think
${user.home} was when you configured your server.xml file?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVo++8AAoJEBzwKT+lPKRYyXYQAMfiycXNOVCXq2LogS5Qf1Ip
nxTrO1PnL8BVod6TbGn40ioLjoWSai7GVfLT4UEIU8cjvqPuFLdBfcvtJVnJU9NL
VFDzwZoiXyYMpImv8spRa1S0GswG9b91EgG+m5uJmGZmfQ4y75Y+Yjrp+EVD0wae
0UHWQb/V7QRHa1eVnbhW7/PdzuvUOe8L6X9JwLnwOYtxKyufrZUwrUidN+zH6K/Q
I2+bZ0zbCIJ9L9qpqnpfx0CptkmS9D9mC/w4tcHhF0ufTklMSeQGrNxAOvuSUtG3
dEQ4bJznA7qfYPJgyQOUYRzgr4vEq0IrRzgkJNIVq2cfVa8DuIIbtBuwVZ5wRK6d
S1FwIM9pNWafyiFkWJ85YpKzeGY2GolBfwiJYbAaarOsuaMatHsUN4LD2PqoXJFH
4kopC8alIecfootyAEZsTspezfZs71sKsaem5n2B8a5lwQHkLImxpG+2U9n8XfXC
2+NEEqey6Twwg776fB9P+49imBhhplOkpr0+kyF90CZUmcWPMx5crq2PXNzBbBJw
qqv0OdwbdKo6Ur7HBOXw0elQ/CMfmbNAvrdWab1VDv+u1LssCjQbkF70oeCOseM4
hkTtiTjmVSY71nNY0kSoMl77XfgcG65bo2vgeO2HhDxidVQGZ5oCUZGux4x8C7Zw
JSbF5g9qcbjtHr8ia6d+
=bnhN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Setting SSL in Tomcat 7.0

Posted by "Joby J. Joseph" <jj...@bankboubyan.com>.
Hi Sanaullah,

When I run the command, it creates the keystore successfulle. I saw all the steps that u mentioned and I am not able to find the created keystore file. I am not getting the location of the file created. That is my problem.


Joby J. Joseph


-----Original Message-----
From: Sanaullah [mailto:sanaullah82@gmail.com] 
Sent: 12/07/2015 1:55 PM
To: Tomcat Users List
Subject: Re: Setting SSL in Tomcat 7.0

>>"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
I don't know whats the output of the above command which run and either its executed successfully or not

You can follow the below example. I am using linux Machine.

root@ubuntu:/home/sanaullah# keytool -genkey -alias tomcat -keyalg RSA

Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  PK
What is the name of your organizational unit?
  [Unknown]:  test
What is the name of your organization?
  [Unknown]:  test
What is the name of your City or Locality?
  [Unknown]:
What is the name of your State or Province?
  [Unknown]:
What is the two-letter country code for this unit?
  [Unknown]:
Is CN=PK, OU=test, O=test, L=Unknown, ST=Unknown, C=Unknown correct?
  [no]:  yes

Enter key password for <tomcat>
        (RETURN if same as keystore password):
root@ubuntu:/home/sanaullah# ls
root@ubuntu:/home/sanaullah# ls /root/.keystore

As i was running the keytool command using root user so the keystore is created in /root/.keystore. you must find the file somewhere in windows and set its path in the connector configuration and also set its password

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

Regards,
Sanaullah





On Sun, Jul 12, 2015 at 2:42 AM, Joby J. Joseph <jj...@bankboubyan.com>
wrote:

> Hi,
>
> Thanks for the reply.
> I have followed the same steps provided by the tomcat documentation.
>
> https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
>
>
> First I created the keystore file by executing the command ...
>
> "%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
>
> Then I added it in the config file.
>
> <Connector
>            protocol="org.apache.coyote.http11.Http11NioProtocol"
>            port="8443" maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="${user.home}/.keystore" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
>
> Here. I got the error as...
>
>
>
> SEVERE: Failed to load keystore type JKS with path 
> C:\Windows\system32\config\systemprofile/.keystore due to 
> C:\Windows\system32\config\systemprofile\.keystore (The system cannot 
> find the file specified)
> java.io.FileNotFoundException:
> C:\Windows\system32\config\systemprofile\.keystore (The system cannot 
> find the file specified)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(Unknown Source)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:400)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:306)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:565)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:505)
>         at
> org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:490)
>         at
> org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
>         at
> org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
>         at
> org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
>         at
> org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>         at
> org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>         at
> org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
>         at 
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
>
>
> So, I did a listing of the keystore file and I got the error as 
> Keystore file does not exist.
>
>
>
>      Joby J. Joseph
>      Systems Engineer -  Application Support
>
>
>
> -----Original Message-----
> From: Sanaullah [mailto:sanaullah82@gmail.com]
> Sent: 12/07/2015 12:37 PM
> To: Tomcat Users List
> Subject: Re: Setting SSL in Tomcat 7.0
>
> Hi Joby,
>
> Where is your keystore file ?
>
> >>keytool error: java.lang.Exception: Keystore file does not exist:
> .keystore
>
> The Error is self explanatory, "Keystore file does not exist"  could 
> you share your server.xml file configuration and also let us know the 
> steps, how did you create the keystore ?
>
> Regards,
> Sanaullah
>
> On Sun, Jul 12, 2015 at 2:23 AM, Joby J. Joseph 
> <jj...@bankboubyan.com>
> wrote:
>
> >  Hi,
> >
> >
> >
> > I need a help for setting up the SSL in Tomcat Server 7.0.
> >
> >
> >
> > I have created keystore and changed the server.xml file. But, I am 
> > getting the following exception.
> >
> >
> >
> > Screen for creating the keystore.
> >
> >
> >
> >
> >
> > After this, I did a listing for the keystore values. It shows an error.
> >
> >
> >
> > keytool -list -keystore .keystore
> >
> > and it gives..
> > keytool error: java.lang.Exception: Keystore file does not exist:
> > .keystore
> >
> >
> >
> > Any suggestion this error.
> >
> > Where is the keystore file located.
> >
> >
> >
> >
> >
> > Thanks in advance…
> >
> >
> >
> >
> >
> >
> >
> >      Joby J. Joseph
> >
> >      Systems Engineer -  Application Support
> >
> >
> >
> >
> > ********************************************************************
> > **
> > **************** This message contains confidential information and 
> > is intended for the use of the addressee only. If you are not the 
> > intended recipient of this communication, please delete it 
> > immediately, do not copy, distribute or otherwise share this 
> > information, and notify the sender promptly.
> >
> > Any views or opinions presented in this e-mail are solely those of 
> > the author and do not necessarily represent those of the Bank. The 
> > Bank does not endorse or accept responsibility for such views and 
> > opinions and accordingly, they are not legally binding on the Bank.
> >
> > WARNING: Although the Bank has taken reasonable precautions to 
> > ensure no viruses are present in this e-mail, the Bank cannot accept 
> > responsibility for any loss or damage arising from the use of this 
> > e-mail or its attachments and shall not be liable for the e-mail 
> > content transmitted over the Internet.
> > *********************************************
> >
>
>
> **********************************************************************
> **************** This message contains confidential information and is 
> intended for the use of the addressee only. If you are not the 
> intended recipient of this communication, please delete it 
> immediately, do not copy, distribute or otherwise share this 
> information, and notify the sender promptly.
>
> Any views or opinions presented in this e-mail are solely those of the 
> author and do not necessarily represent those of the Bank. The Bank 
> does not endorse or accept responsibility for such views and opinions 
> and accordingly, they are not legally binding on the Bank.
>
> WARNING: Although the Bank has taken reasonable precautions to ensure 
> no viruses are present in this e-mail, the Bank cannot accept 
> responsibility for any loss or damage arising from the use of this 
> e-mail or its attachments and shall not be liable for the e-mail 
> content transmitted over the Internet.
> *********************************************
>

**************************************************************************************
This message contains confidential information and is intended for the use of the addressee only. If you are not the intended recipient of this communication, please delete it immediately, do not copy, distribute or otherwise share this information, and notify the sender promptly.

Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the Bank. The Bank does not endorse or accept responsibility for such views and opinions and accordingly, they are not legally binding on the Bank.

WARNING: Although the Bank has taken reasonable precautions to ensure no viruses are present in this e-mail, the Bank cannot accept responsibility for any loss or damage arising from the use of this e-mail or its attachments and shall not be liable for the e-mail content transmitted over the Internet.
*********************************************

Re: Setting SSL in Tomcat 7.0

Posted by Sanaullah <sa...@gmail.com>.
>>"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
I don't know whats the output of the above command which run and either its
executed successfully or not

You can follow the below example. I am using linux Machine.

root@ubuntu:/home/sanaullah# keytool -genkey -alias tomcat -keyalg RSA

Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  PK
What is the name of your organizational unit?
  [Unknown]:  test
What is the name of your organization?
  [Unknown]:  test
What is the name of your City or Locality?
  [Unknown]:
What is the name of your State or Province?
  [Unknown]:
What is the two-letter country code for this unit?
  [Unknown]:
Is CN=PK, OU=test, O=test, L=Unknown, ST=Unknown, C=Unknown correct?
  [no]:  yes

Enter key password for <tomcat>
        (RETURN if same as keystore password):
root@ubuntu:/home/sanaullah# ls
root@ubuntu:/home/sanaullah# ls /root/.keystore

As i was running the keytool command using root user so the keystore is
created in /root/.keystore. you must find the file somewhere in windows and
set its path in the connector configuration and also set its password

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

Regards,
Sanaullah





On Sun, Jul 12, 2015 at 2:42 AM, Joby J. Joseph <jj...@bankboubyan.com>
wrote:

> Hi,
>
> Thanks for the reply.
> I have followed the same steps provided by the tomcat documentation.
>
> https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
>
>
> First I created the keystore file by executing the command ...
>
> "%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
>
> Then I added it in the config file.
>
> <Connector
>            protocol="org.apache.coyote.http11.Http11NioProtocol"
>            port="8443" maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="${user.home}/.keystore" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
>
> Here. I got the error as...
>
>
>
> SEVERE: Failed to load keystore type JKS with path
> C:\Windows\system32\config\systemprofile/.keystore due to
> C:\Windows\system32\config\systemprofile\.keystore (The system cannot find
> the file specified)
> java.io.FileNotFoundException:
> C:\Windows\system32\config\systemprofile\.keystore (The system cannot find
> the file specified)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(Unknown Source)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:400)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:306)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:565)
>         at
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:505)
>         at
> org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:490)
>         at
> org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
>         at
> org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
>         at
> org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
>         at
> org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>         at
> org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>         at
> org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
>
>
> So, I did a listing of the keystore file and I got the error as Keystore
> file does not exist.
>
>
>
>      Joby J. Joseph
>      Systems Engineer -  Application Support
>
>
>
> -----Original Message-----
> From: Sanaullah [mailto:sanaullah82@gmail.com]
> Sent: 12/07/2015 12:37 PM
> To: Tomcat Users List
> Subject: Re: Setting SSL in Tomcat 7.0
>
> Hi Joby,
>
> Where is your keystore file ?
>
> >>keytool error: java.lang.Exception: Keystore file does not exist:
> .keystore
>
> The Error is self explanatory, "Keystore file does not exist"  could you
> share your server.xml file configuration and also let us know the steps,
> how did you create the keystore ?
>
> Regards,
> Sanaullah
>
> On Sun, Jul 12, 2015 at 2:23 AM, Joby J. Joseph <jj...@bankboubyan.com>
> wrote:
>
> >  Hi,
> >
> >
> >
> > I need a help for setting up the SSL in Tomcat Server 7.0.
> >
> >
> >
> > I have created keystore and changed the server.xml file. But, I am
> > getting the following exception.
> >
> >
> >
> > Screen for creating the keystore.
> >
> >
> >
> >
> >
> > After this, I did a listing for the keystore values. It shows an error.
> >
> >
> >
> > keytool -list -keystore .keystore
> >
> > and it gives..
> > keytool error: java.lang.Exception: Keystore file does not exist:
> > .keystore
> >
> >
> >
> > Any suggestion this error.
> >
> > Where is the keystore file located.
> >
> >
> >
> >
> >
> > Thanks in advance…
> >
> >
> >
> >
> >
> >
> >
> >      Joby J. Joseph
> >
> >      Systems Engineer -  Application Support
> >
> >
> >
> >
> > **********************************************************************
> > **************** This message contains confidential information and is
> > intended for the use of the addressee only. If you are not the
> > intended recipient of this communication, please delete it
> > immediately, do not copy, distribute or otherwise share this
> > information, and notify the sender promptly.
> >
> > Any views or opinions presented in this e-mail are solely those of the
> > author and do not necessarily represent those of the Bank. The Bank
> > does not endorse or accept responsibility for such views and opinions
> > and accordingly, they are not legally binding on the Bank.
> >
> > WARNING: Although the Bank has taken reasonable precautions to ensure
> > no viruses are present in this e-mail, the Bank cannot accept
> > responsibility for any loss or damage arising from the use of this
> > e-mail or its attachments and shall not be liable for the e-mail
> > content transmitted over the Internet.
> > *********************************************
> >
>
>
> **************************************************************************************
> This message contains confidential information and is intended for the use
> of the addressee only. If you are not the intended recipient of this
> communication, please delete it immediately, do not copy, distribute or
> otherwise share this information, and notify the sender promptly.
>
> Any views or opinions presented in this e-mail are solely those of the
> author and do not necessarily represent those of the Bank. The Bank does
> not endorse or accept responsibility for such views and opinions and
> accordingly, they are not legally binding on the Bank.
>
> WARNING: Although the Bank has taken reasonable precautions to ensure no
> viruses are present in this e-mail, the Bank cannot accept responsibility
> for any loss or damage arising from the use of this e-mail or its
> attachments and shall not be liable for the e-mail content transmitted over
> the Internet.
> *********************************************
>

Re: Setting SSL in Tomcat 7.0

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-07-12 12:42 GMT+03:00 Joby J. Joseph <jj...@bankboubyan.com>:
> Hi,
>
> Thanks for the reply.
> I have followed the same steps provided by the tomcat documentation.
>
> https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
>
>
> First I created the keystore file by executing the command ...
>
> "%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
>

Read the rules:
http://tomcat.apache.org/lists.html#tomcat-users
-> 6. Top-posting is bad.


The manual for keytool is part of JDK documentation
http://docs.oracle.com/javase/7/docs/technotes/tools/index.html
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/keytool.html

If "-keystore" option is not given (with explicit path to .keystore),
the default is "the file named .keystore in the user's home
directory".  That is "%USERPROFILE%\.keystore"

On Windows 7 %USERPROFILE% is usually C:\Users\<username>







> Then I added it in the config file.
>
> <Connector
>            protocol="org.apache.coyote.http11.Http11NioProtocol"
>            port="8443" maxThreads="200"
>            scheme="https" secure="true" SSLEnabled="true"
>            keystoreFile="${user.home}/.keystore" keystorePass="changeit"
>            clientAuth="false" sslProtocol="TLS"/>
>
> Here. I got the error as...
>
>
>
> SEVERE: Failed to load keystore type JKS with path C:\Windows\system32\config\systemprofile/.keystore due to C:\Windows\system32\config\systemprofile\.keystore (The system cannot find the file specified)
> java.io.FileNotFoundException: C:\Windows\system32\config\systemprofile\.keystore (The system cannot find the file specified)

I guess that you (the user running keytool) and the user running
Tomcat are two different users,  so their "%USERPROFILE%" is different
-- see the above path.  It looks that you are running Tomcat with a
system service account.



Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Setting SSL in Tomcat 7.0

Posted by "Joby J. Joseph" <jj...@bankboubyan.com>.
Hi,

Thanks for the reply. 
I have followed the same steps provided by the tomcat documentation.

https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration


First I created the keystore file by executing the command ... 

"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA

Then I added it in the config file.

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

Here. I got the error as...



SEVERE: Failed to load keystore type JKS with path C:\Windows\system32\config\systemprofile/.keystore due to C:\Windows\system32\config\systemprofile\.keystore (The system cannot find the file specified)
java.io.FileNotFoundException: C:\Windows\system32\config\systemprofile\.keystore (The system cannot find the file specified)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(Unknown Source)
	at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:400)
	at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:306)
	at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:565)
	at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:505)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:490)
	at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
	at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
	at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
	at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
	at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)


So, I did a listing of the keystore file and I got the error as Keystore file does not exist.



     Joby J. Joseph
     Systems Engineer -  Application Support



-----Original Message-----
From: Sanaullah [mailto:sanaullah82@gmail.com] 
Sent: 12/07/2015 12:37 PM
To: Tomcat Users List
Subject: Re: Setting SSL in Tomcat 7.0

Hi Joby,

Where is your keystore file ?

>>keytool error: java.lang.Exception: Keystore file does not exist:
.keystore

The Error is self explanatory, "Keystore file does not exist"  could you share your server.xml file configuration and also let us know the steps, how did you create the keystore ?

Regards,
Sanaullah

On Sun, Jul 12, 2015 at 2:23 AM, Joby J. Joseph <jj...@bankboubyan.com>
wrote:

>  Hi,
>
>
>
> I need a help for setting up the SSL in Tomcat Server 7.0.
>
>
>
> I have created keystore and changed the server.xml file. But, I am 
> getting the following exception.
>
>
>
> Screen for creating the keystore.
>
>
>
>
>
> After this, I did a listing for the keystore values. It shows an error.
>
>
>
> keytool -list -keystore .keystore
>
> and it gives..
> keytool error: java.lang.Exception: Keystore file does not exist: 
> .keystore
>
>
>
> Any suggestion this error.
>
> Where is the keystore file located.
>
>
>
>
>
> Thanks in advance…
>
>
>
>
>
>
>
>      Joby J. Joseph
>
>      Systems Engineer -  Application Support
>
>
>
>
> **********************************************************************
> **************** This message contains confidential information and is 
> intended for the use of the addressee only. If you are not the 
> intended recipient of this communication, please delete it 
> immediately, do not copy, distribute or otherwise share this 
> information, and notify the sender promptly.
>
> Any views or opinions presented in this e-mail are solely those of the 
> author and do not necessarily represent those of the Bank. The Bank 
> does not endorse or accept responsibility for such views and opinions 
> and accordingly, they are not legally binding on the Bank.
>
> WARNING: Although the Bank has taken reasonable precautions to ensure 
> no viruses are present in this e-mail, the Bank cannot accept 
> responsibility for any loss or damage arising from the use of this 
> e-mail or its attachments and shall not be liable for the e-mail 
> content transmitted over the Internet.
> *********************************************
>

**************************************************************************************
This message contains confidential information and is intended for the use of the addressee only. If you are not the intended recipient of this communication, please delete it immediately, do not copy, distribute or otherwise share this information, and notify the sender promptly.

Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the Bank. The Bank does not endorse or accept responsibility for such views and opinions and accordingly, they are not legally binding on the Bank.

WARNING: Although the Bank has taken reasonable precautions to ensure no viruses are present in this e-mail, the Bank cannot accept responsibility for any loss or damage arising from the use of this e-mail or its attachments and shall not be liable for the e-mail content transmitted over the Internet.
*********************************************

Re: Setting SSL in Tomcat 7.0

Posted by Sanaullah <sa...@gmail.com>.
Hi Joby,

Where is your keystore file ?

>>keytool error: java.lang.Exception: Keystore file does not exist:
.keystore

The Error is self explanatory, "Keystore file does not exist"  could you
share your server.xml file configuration and also let us know the steps,
how did you create the keystore ?

Regards,
Sanaullah

On Sun, Jul 12, 2015 at 2:23 AM, Joby J. Joseph <jj...@bankboubyan.com>
wrote:

>  Hi,
>
>
>
> I need a help for setting up the SSL in Tomcat Server 7.0.
>
>
>
> I have created keystore and changed the server.xml file. But, I am getting
> the following exception.
>
>
>
> Screen for creating the keystore.
>
>
>
>
>
> After this, I did a listing for the keystore values. It shows an error.
>
>
>
> keytool -list -keystore .keystore
>
> and it gives..
> keytool error: java.lang.Exception: Keystore file does not exist: .keystore
>
>
>
> Any suggestion this error.
>
> Where is the keystore file located.
>
>
>
>
>
> Thanks in advance…
>
>
>
>
>
>
>
>      Joby J. Joseph
>
>      Systems Engineer -  Application Support
>
>
>
>
> **************************************************************************************
> This message contains confidential information and is intended for the use
> of the addressee only. If you are not the intended recipient of this
> communication, please delete it immediately, do not copy, distribute or
> otherwise share this information, and notify the sender promptly.
>
> Any views or opinions presented in this e-mail are solely those of the
> author and do not necessarily represent those of the Bank. The Bank does
> not endorse or accept responsibility for such views and opinions and
> accordingly, they are not legally binding on the Bank.
>
> WARNING: Although the Bank has taken reasonable precautions to ensure no
> viruses are present in this e-mail, the Bank cannot accept responsibility
> for any loss or damage arising from the use of this e-mail or its
> attachments and shall not be liable for the e-mail content transmitted over
> the Internet.
> *********************************************
>