Hi Daniel,

I have generated the csr with the keytool:

keytool -certreq -sigalg RSA -alias <alias>  -filename certreq.csr -keystore 
<keystorename>

This csr has the DN formatted like CN=<server name>, OU=<OU Name>, 
O=<Organization Name>, L=<Location>, ST=<State>, C=<country>
which is based on the information we give while genarating the keystore.

But the signing authority in our domain accepts the dn format with cn=<server 
name>,ou=Devices,o=<organization>,c=<country> 

When I request for certificate using the keytool based CSR, I get the invalid 
request error as the forat is different.

Is there a way I can generate the CSR in this format usng keytool?

Keytool always asks for location information for generating the keystore.

Thanks,
Siva Kumar Balaguru.

-----Original Message-----
From: Daniel Mikusa [mailto:dmik...@gopivotal.com] 
Sent: Wednesday, December 04, 2013 6:45 PM
To: Tomcat Users List
Subject: Re: enable SSL for Tomcat

On Dec 4, 2013, at 7:40 AM, sivakumar_balag...@contractor.amat.com wrote:

> Hi Ognjen,
> 
> I have tried this as well.
> 
> I have generated a new keystore. By default, keytool generates a keystore 
> with a private key.

Good.  You're half way there.

> 
> I have imported the trusted signed certificate to this keystore.

Huh?  Which signed certificate?  The one that you had generated using the MS 
tool?  If so, that's not going to work.  You need to generate a new CSR based 
on the keystore's private cert and get a new signed certificate from your CA.  
Then import the new signed cert into your keystore.

Dan


> 
> But Tomcat is using the unsigned key/certificate which has been generated by 
> default with keytool. 
> 
> The domain is not trusting this certificate as it is private self-signed 
> certificate not the trusted one and SSL is not accomplished.
> 
> As an alternative, I have deleted the self-signed private key from the 
> keystore so that the keystore contains only one certificate which is signed 
> by the certified authority(Entrust).
> 
> This couldn't help me in enabling SSL.
> 
> 
> Regards!!
> Siva Kumar Balaguru
> SME | Identity, Security Access and Messaging Services (ISAMS) | 
> Applied Materials India Pvt. Ltd. | Chennai | India Mobile : 
> +91-8438569069|Extn : 7002 | Tie Line: #9575 7002
> 
> What is ISAMS?  Please see our site to learn more: isams.amat.com
>  
> The content of this message is Applied Materials Confidential. If you 
> are not the intended recipient and have received this message in 
> error, any use or distribution is prohibited. Please notify me 
> immediately by reply e-mail and delete this message from your computer 
> system. Thank you
> ** Save a tree. Please don't print this e-mail unless needed.
> 
> -----Original Message-----
> From: Ognjen Blagojevic [mailto:ognjen.d.blagoje...@gmail.com]
> Sent: Wednesday, December 04, 2013 5:25 PM
> To: Tomcat Users List
> Subject: Re: enable SSL for Tomcat
> 
> Sivakumar,
> 
> On 4.12.2013 12:11, sivakumar_balag...@contractor.amat.com wrote:
>> I need to enable SSL for tomcat in a windows server 2008. I have 
>> generated a certificate using the csr generated by this command:
>> certreq -new request.inf request.req
> (...)
>> I have imported this certificate to CACERTS using keytool and uncommented 
>> the connector configuration in servers.xml in APACHE conf folder.
> 
> You used Microsoft tool (certreq) to generate the private key and CSR, and 
> Java tool (keytool) to import the certificate into Java keystore. 
> That is your problem.
> 
> You need to, *either*:
> 
> 1. Start from the beginning: Use Java keytool to generate private key in Java 
> keystore, to create CSR, and to import certificate into that SAME Java 
> keystore. You should not use "cacerts" file as you keystore, but other file 
> for that purpose (e.g. c:\users\sivakumar\server.jks).
> 
> 2. Reuse what you have so far: Find where certreq stored private key; export 
> private key; import private key and certificate into PKCS keystore; convert 
> PKCS keystore into new keystore in JKS format.
> 
> You should consider which one is easier for you, and then we can help you 
> along the way.
> 
> 
>> Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" 
>> SSLEnabled="true" keystoreFile="C:\Program 
>> Files\Java\jre7\lib\security\CACERTS" keystorePass="changeit" 
>> maxThreads="300" scheme="https" secure="true" clientAuth="false" 
>> sslProtocol="TLS"
> 
> Whatever you do, you will have to change keystoreFile attribute from 
> "C:\Program Files\Java\jre7\lib\security\CACERTS" to e.g.
> "c:\users\sivakumar\server.jks."
> 
> 
>> I didn't find any error on startup of Tomcat but still ssl is not enabled.
> 
> That is strange. What you described would result in cacerts file 
> containing server certificate without the private key. Therefore I 
> would expect that Tomcat complains about inability to find the private key.
> 
> Either way, cacerts file is not the right place to store server 
> private key and certificate. That file should contain only 
> certificates from trusted CA.
> 
> -Ognjen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
> KCB  [  X  ܚX KK[XZ[
 \ \  ][  X  ܚX P X ]
 \X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
 \ \  Z[ X ]
 \X K ܙ B 


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

Reply via email to