tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Deploying .ca-bundle file & .crt file as SSL certificates
Date Wed, 26 Nov 2014 18:21:02 GMT
Hash: SHA256

To whom it may concern,

On 11/26/14 12:00 PM, Kernel freak wrote:
> On Wed, Nov 26, 2014 at 5:33 PM, Christopher Schultz < 
>> wrote:
> To whom it may concern,
> On 11/26/14 9:03 AM, Kernel freak wrote:
>>>> After arguing with the admins for all this time, I finally
>>>> have the few files ready. I have the following files :
>>>> keystore.p12
> That should contain your key. Can you confirm that with a 'keytool
> -list'?
>>>> server.crt
> Is this the certificate that was signed by the CA?
>> Yes, this is certificated signed by CA, but its a
>> servercertificate, the domain certificate is below.

I have no idea what a "domain certificate" is. A cert is a cert, and
it's signed by another cert all the way up to a root cert, known as a
CA who has widespread trust.

>>>> ssl-cert-snakeoil.key
> Uh, oh. That looks like one of OpenSSL's built-in CAs that are
> used for documentation and instructional purposes. I hope this
> isn't being used for anything at all.
> This should be the bundle of certificates for your domain, which
> may include intermediate certificates. Are you using your own
> internal CA or something?
> Which certificate is this?
>> This is the SSL certificate which has to be deployed.
> Is this the CSR that you generated yourself?
>> No, this is also provided by hosting guys

So, did your "hosting guys" generate everything for you, then? It's
customary to create your own key and CSR and then merely have the CA
sign the CSR which results in your certificate. You import your
certificate and, if necessary, any intermediate certificates your
clients will require to form a trust chain from your server's cert up
to the root that the client trusts.

> Weird. Okay, I would expect to have the key
> that was used to generate, and that
> is a signed version of that CSR. That should be
> all you need... I'm not sure what all the other stuff is.
>>>> vsftpd.pem.
> What is this?
>>>> I did the following as Christoph said:
>>>> root@domainname:/etc/ssl/private# openssl pkcs12 -export -in 
>>>> server.crt -inkey ssl-cert-snakeoil.key -certfile 
>>>> -out keystore.p12 -chain  (pressed enter
>>>> here) unable to load certificates  // This is the error.
> I think you might want to do this:
> $ openssl pkcs12 -export -in \ -inkey
> \ -certfile \ -out
> keystore.p21 -chain
> $ keytool -importkeystore -srckeystore keystore.p12 \ -srcstoretype
> pkcs12 \ -destkeystore keystore.jks
> You are supposed to be able to use PKCS12 keystores directly with 
> Tomcat, but IIRC it's a pain and a bit more finicky than with just
> a "normal" JKS-format keystore.
>>>> If i just plain import the .crt file like this :
>>>> keytool -import -alias tomcat -file
>>>> -keystore /root/.keystore
> A couple of things:
> 1. Don't run as root. Not for anything. Not even to run keytool. 2.
> Don't store your keystore under /root/.keystore, or you'll
> (likely) have to run Tomcat as root. You can put your keystore
> anywhere you want and point Tomcat to it explicitly. 3. If you
> import a certificate into a keystore and there is nothing else in
> it (the keystore), then you can't perform a handshake because the
> key is required for secure communication.
>>>> Then firefox gives me this error :
>>>> An error occurred during a connection to
>>>> Cannot communicate securely with peer:
>>>> no common encryption algorithm(s). (Error code:
>>>> ssl_error_no_cypher_overlap)
>>>> The page you are trying to view cannot be shown because the 
>>>> authenticity of the received data could not be verified.
>>>> Please contact the website owners to inform them of this
>>>> problem.
> The no_cipher_overlap error is likely to be incorrect... the real 
> problem is that the server can't decrypt the client's handshake 
> because the key is unavailable.
> I think you might need to get some help with this from someone else
> at your organization... someone who is a bit more versed in PKI
> and configuring TLS for web servers.
>> I have told you what key is for what, can you give me the updated
>> commands please, unfortunately there is no one here who knows
>> this.

I can't understand something on your behalf: you have to understand it
yourself. Once you understand what is going on, these commands will
make sense and you should be able to execute them without guessing.

If you can't figure it out, hire someone who already knows.

The only weird part about Java keystores is the use of an "alias"
which allows you to pack a keystore full of all kinds of goodies and
then refer to specific items by their names (I don't know why CN isn't
a good enough identifier, but I guess keystore wonks thought it would
be a good idea). It's not a bad idea to give every item in your
keystore (key, certificate, etc.) an alias so you can be explicit
about which one you are talking about. I also recommend NOT packing
too much crap into a keystore: keep things simple and only put a
single key, your server's certificate and the chain required for the
CA into your keystore.

- -chris
Version: GnuPG v1
Comment: GPGTools -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message