tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Restricting ciphers
Date Thu, 10 Jan 2013 15:05:48 GMT

 terminology :
the X509 standard defines certificates, and RSA and DSA are two of the public key algorithms
that can be used in those certificates;
certificates are used to hold public keys, and never private keys.
PKCS#12 is a standard for a container which holds an X509 client certificates and  private
keys So, if you're examining a PKCS#12 file (typically .p12 extension or a .pfx extension),
then you already know:
It contains at least one X509 client certificate and
corresponding private keys.
All you don't know is whether those certificate & private key are RSA or DSA algorithms

You can check this by extracting the certificate(s), and then examine them:openssl pkcs12
-in mycert.p12 -clcerts -nokeys -out mycert.crt

openssl x509 -in mycert.crt -text
The text output of the openssl x509 command should include a Subject Public Key section, which
will include fields that let 

you see if it's an RSA or DSA key (along with the key size).
PublicKey Generation:
to generate a public-key from PKCS12 privateKeyAndX509Cert use openssl openssl pkcs12 -in
myFile.p12 -out myPublicKey.pem -clcerts -nokeys KeyAlgorithms:
KeyAlgorithms are categorised to their cipher-groups symmetric ciphers, public-key 
ciphers, and one-way hashing to list available ciphers within AES algorithm use openssl e.g.
openssl ciphers -v 'AES+HIGH'

cipherGroup is categorised by keysize within cipher-groups (usually a 4digit number which
is a power  of 2 e.g. 1024 and 2048) each permutation of cipherGroup-KeySize is
further categorised according to implemented ModeOfOperation 

ECB, CBC and PCBC are the usual choices for the optional ModeOfOperation parameter Determining
the ALGO-CIPHER supported by your key so we can see that public keys contain a algorithm-cipher
combination but how to determine the algo-cipher supported by your key:

keytool -list -v -keystore fubar.pfx -storetype PKCS12 Here is output:
Certificate fingerprints:
         MD5:           SHA1:          Signature algorithm name: SHA1withRSA Providers (SUN,
SunJCE, SunJSSE,SunRsaSign, IBMJSSE, bcprov-jdkNN-MMM) Lets stick with SunJSSE as our provider
supported ciphers will be those ciphers which match SHA1 with RSA from this list: so what you
are asking Tomcat Connector to do is

1)export contents of supplied keystoreFile key of keystoreType PKCS12

2)determine Signature algorithm name

3)aggregate cipherSuite by determining Signature specific supported ciphers from Signature
algorithm name from
4)reference ciphers attribute from Tomcat <Connector

5)determine SignatureSpecificSupportedCiphers from 3) and implement ONLY those ciphers which
match exactly 
to the ciphers listed in Tomcat Connector 5)

(i have not seen this currently implemented)
do not alter or disrupt this transmission
 > Date: Thu, 10 Jan 2013 11:44:49 +0400
> Subject: Re: Restricting ciphers
> From:
> To:
> 2013/1/10 Baron Fujimoto <>:
> > On Wed, Jan 09, 2013 at 01:08:01PM +0400, Konstantin Kolinko wrote:
> >>2013/1/9 Baron Fujimoto <>:
> >>> I'm attempting to mitigate BEAST (CVE-2011-3389) attacks on Tomcat 6.0.35.
> >>> My understanding is that the attack applies only to CBC ciphers, and that
> >>> RC4 ciphers are not vulnerable, so I am attempting to restrict the set of
> >>> ciphers that Tomcat uses with the following config for a connector:
> >>>
> >>>   <Connector protocol="HTTP/1.1" SSLEnabled="true"
> >>>              address=""
> >>>              port="8443"
> >>>              maxThreads="150" scheme="https" secure="true"
> >>>              keystoreFile="/path/to/keystore"
> >>>              keystoreType="pkcs12"
> >>>              ciphers="TLS_RSA_WITH_RC4_128_SHA,
> >>>                       TLS_RSA_WITH_RC4_128_MD5,
> >>>                       SSL_CK_RC4_128_WITH_MD5"
> >>>              clientAuth="false" sslProtocol="TLS" />
> >>>(...)
> >>>
> >>
> >>As can be seen from your usage of "keystoreType" attribute, you are
> >>using Java implementation of the Connector,  not openssl/APR one.
> >>
> >>You should look into Java documentation for their cipher names.
> >>
> >>See this thread from October 2009:
> >>
> >
> > Ahh, that was it! It did not occur to me that OpenSSL and Java might
> > name the ciphers differently.  If I restrict the ciphers to those
> > from the (differently named) set used by Java, it works as expected.
> > Mahalo!
> >
> >   ciphers="SSL_RSA_WITH_RC4_128_MD5,
> >            SSL_RSA_WITH_RC4_128_SHA,
> >            TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
> >            TLS_ECDHE_RSA_WITH_RC4_128_SHA,
> >            TLS_ECDH_ECDSA_WITH_RC4_128_SHA,
> >            TLS_ECDH_RSA_WITH_RC4_128_SHA"
> >
> Good.
> I used your example to create a FAQ page,
> Best regards,
> Konstantin Kolinko
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message