UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » General
  • » OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

#1 2011-02-14 09:56 PM

RM
Member
Registered: 2010-10-22
Posts: 9

OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

Hello

I'm here again with more questions that I can't find answers with google.

1) Do you know why all the ciphers that has EXP on the name never establish a valid connection? I tried different servers that support ciphers with EXPORT and I always get something like that...

Example of ciphers supported listed:

TLS_RSA_EXPORT1024_WITH_RC4_56_MD5 (0x60)
TLS_RSA_EXPORT1024_WITH_RC4_56_SHA (0x64)

Connecting with SSL with one of the above ciphers:

CONNECTED(00000003)
140735078194428:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 59 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---


Do you know why this happens? I don't understand why someone implement a cipher if it can't be used...

2) I use openssl to verify that I can establish a session with a choose cipher. Like this:

openssl s_client -connect www.mysite.com:443 -cipher RC4-MD5

However, now I need to send a lot of requests to that given site using always this cipher, that's not possible to be done by hand, so I need a kind of proxy. Do you know a tool? A way or even a workaround to integrate openssl with any available proxy? For example, I need my proxy listening on port 3128, but everytime that my app connect to it, the proxy needs to send a request to www.mysite.com over SSL, the proxy has to enforce for example the RC4-MD5 cipher. Any idea?

Change the source application that generate the requests is not a option in this case.

Thank you.

Offline

#2 2011-02-14 11:50 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

The "RC4-MD5" you're using is actually an SSLv3 cypher: SSL3_TXT_RSA_RC4_128_MD5...  You're trying to instead use the experimental TLSv1 version, which is only supported if you define some EXPERIMENTAL macro when compiling the library...  (The text name of the one you are trying to use is "EXP1024-RC4-MD5"; try that with the openssl client, and I'm sure it'll fail as well...)

So, either use SSLv3, or enable the experimental TLSv1 cyphers in your copy of the library...

Offline

#3 2011-02-15 12:58 AM

RM
Member
Registered: 2010-10-22
Posts: 9

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

Hi RobSeace

Thanks for clarification, now I understand that to use any EXP_* I have to enable EXPERIMENTAL macro before compiling. Make sense.

I found a site that tells me which ciphers my website supports, see: https://www.ssllabs.com/ssldb/index.html

However, some of the ciphers it point never work. It always produce errors such this:

openssl s_client -connect www.mysite.com:443 -cipher ECDHE-RSA-AES128-SHA
CONNECTED(00000003)
140735078194428:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 123 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

Any idea why? Maybe the SSLLabs is guessing my cipher wrong?

I can list all ciphers, but it doesn't tell me if it's SSLv3, SSLv2 or even TLSv1.

openssl ciphers
ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:ECDH-RSA-AES256-SHA:ECDH-ECDSA-AES256-SHA:AES256-SHA:CAMELLIA256-SHA:PSK-AES256-CBC-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:ECDH-RSA-DES-CBC3-SHA:ECDH-ECDSA-DES-CBC3-SHA:DES-CBC3-SHA:PSK-3DES-EDE-CBC-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-SEED-SHA:DHE-DSS-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-DSS-CAMELLIA128-SHA:ECDH-RSA-AES128-SHA:ECDH-ECDSA-AES128-SHA:AES128-SHA:SEED-SHA:CAMELLIA128-SHA:IDEA-CBC-SHA:PSK-AES128-CBC-SHA:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:RC4-SHA:RC4-MD5:PSK-RC4-SHA:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:EXP-RC2-CBC-MD5:EXP-RC4-MD5

There is any site that has a basic description for each of this ciphers supported in openssl?

Also, any idea about the question 2?

Thanks and sorry for too much questions...

Offline

#4 2011-02-15 02:41 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

Do "openssl ciphers -v", and it'll tell you which version it's for...  (The ciphers are generally shared between SSLv3 and TLSv1, anyway...)

Why exactly are you trying to use a specific cipher, anyway?  Why not let it just pick an appropriate one that it thinks is best, given what is supported on both sides?

As for your proxy question, I'm not sure I understand...  You've got an app that makes requests that you want to pass on to some server over SSL?  Does the app making the requests currently just send plaintext or does it already use SSL?  If the latter, I'm not sure why you can't have it talk directly to the server without the need of a proxy...  But, if the former, then I guess I understand what you're doing...  There are existing tools like stunnel, which may suit your needs...  Or, you could just write your own...

Offline

#5 2011-02-15 04:30 PM

RM
Member
Registered: 2010-10-22
Posts: 9

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

Thanks for reply RobSeace.

Interesting, thanks for the info. It worked, but mine just have SSLv3, no one with TLS. Strange?

ECDHE-RSA-AES256-SHA    SSLv3 Kx=ECDH     Au=RSA  Enc=AES(256)  Mac=SHA1
ECDHE-ECDSA-AES256-SHA  SSLv3 Kx=ECDH     Au=ECDSA Enc=AES(256)  Mac=SHA1
DHE-RSA-AES256-SHA      SSLv3 Kx=DH       Au=RSA  Enc=AES(256)  Mac=SHA1
DHE-DSS-AES256-SHA      SSLv3 Kx=DH       Au=DSS  Enc=AES(256)  Mac=SHA1
DHE-RSA-CAMELLIA256-SHA SSLv3 Kx=DH       Au=RSA  Enc=Camellia(256) Mac=SHA1
DHE-DSS-CAMELLIA256-SHA SSLv3 Kx=DH       Au=DSS  Enc=Camellia(256) Mac=SHA1
ECDH-RSA-AES256-SHA     SSLv3 Kx=ECDH/RSA Au=ECDH Enc=AES(256)  Mac=SHA1
ECDH-ECDSA-AES256-SHA   SSLv3 Kx=ECDH/ECDSA Au=ECDH Enc=AES(256)  Mac=SHA1
AES256-SHA              SSLv3 Kx=RSA      Au=RSA  Enc=AES(256)  Mac=SHA1
CAMELLIA256-SHA         SSLv3 Kx=RSA      Au=RSA  Enc=Camellia(256) Mac=SHA1
PSK-AES256-CBC-SHA      SSLv3 Kx=PSK      Au=PSK  Enc=AES(256)  Mac=SHA1
ECDHE-RSA-DES-CBC3-SHA  SSLv3 Kx=ECDH     Au=RSA  Enc=3DES(168) Mac=SHA1
ECDHE-ECDSA-DES-CBC3-SHA SSLv3 Kx=ECDH     Au=ECDSA Enc=3DES(168) Mac=SHA1
EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
EDH-DSS-DES-CBC3-SHA    SSLv3 Kx=DH       Au=DSS  Enc=3DES(168) Mac=SHA1
ECDH-RSA-DES-CBC3-SHA   SSLv3 Kx=ECDH/RSA Au=ECDH Enc=3DES(168) Mac=SHA1
ECDH-ECDSA-DES-CBC3-SHA SSLv3 Kx=ECDH/ECDSA Au=ECDH Enc=3DES(168) Mac=SHA1
DES-CBC3-SHA            SSLv3 Kx=RSA      Au=RSA  Enc=3DES(168) Mac=SHA1
PSK-3DES-EDE-CBC-SHA    SSLv3 Kx=PSK      Au=PSK  Enc=3DES(168) Mac=SHA1
ECDHE-RSA-AES128-SHA    SSLv3 Kx=ECDH     Au=RSA  Enc=AES(128)  Mac=SHA1
ECDHE-ECDSA-AES128-SHA  SSLv3 Kx=ECDH     Au=ECDSA Enc=AES(128)  Mac=SHA1
DHE-RSA-AES128-SHA      SSLv3 Kx=DH       Au=RSA  Enc=AES(128)  Mac=SHA1
DHE-DSS-AES128-SHA      SSLv3 Kx=DH       Au=DSS  Enc=AES(128)  Mac=SHA1
DHE-RSA-SEED-SHA        SSLv3 Kx=DH       Au=RSA  Enc=SEED(128) Mac=SHA1
DHE-DSS-SEED-SHA        SSLv3 Kx=DH       Au=DSS  Enc=SEED(128) Mac=SHA1
DHE-RSA-CAMELLIA128-SHA SSLv3 Kx=DH       Au=RSA  Enc=Camellia(128) Mac=SHA1
DHE-DSS-CAMELLIA128-SHA SSLv3 Kx=DH       Au=DSS  Enc=Camellia(128) Mac=SHA1
ECDH-RSA-AES128-SHA     SSLv3 Kx=ECDH/RSA Au=ECDH Enc=AES(128)  Mac=SHA1
ECDH-ECDSA-AES128-SHA   SSLv3 Kx=ECDH/ECDSA Au=ECDH Enc=AES(128)  Mac=SHA1
AES128-SHA              SSLv3 Kx=RSA      Au=RSA  Enc=AES(128)  Mac=SHA1
SEED-SHA                SSLv3 Kx=RSA      Au=RSA  Enc=SEED(128) Mac=SHA1
CAMELLIA128-SHA         SSLv3 Kx=RSA      Au=RSA  Enc=Camellia(128) Mac=SHA1
IDEA-CBC-SHA            SSLv3 Kx=RSA      Au=RSA  Enc=IDEA(128) Mac=SHA1
PSK-AES128-CBC-SHA      SSLv3 Kx=PSK      Au=PSK  Enc=AES(128)  Mac=SHA1
ECDHE-RSA-RC4-SHA       SSLv3 Kx=ECDH     Au=RSA  Enc=RC4(128)  Mac=SHA1
ECDHE-ECDSA-RC4-SHA     SSLv3 Kx=ECDH     Au=ECDSA Enc=RC4(128)  Mac=SHA1
ECDH-RSA-RC4-SHA        SSLv3 Kx=ECDH/RSA Au=ECDH Enc=RC4(128)  Mac=SHA1
ECDH-ECDSA-RC4-SHA      SSLv3 Kx=ECDH/ECDSA Au=ECDH Enc=RC4(128)  Mac=SHA1
RC4-SHA                 SSLv3 Kx=RSA      Au=RSA  Enc=RC4(128)  Mac=SHA1
RC4-MD5                 SSLv3 Kx=RSA      Au=RSA  Enc=RC4(128)  Mac=MD5
PSK-RC4-SHA             SSLv3 Kx=PSK      Au=PSK  Enc=RC4(128)  Mac=SHA1
EDH-RSA-DES-CBC-SHA     SSLv3 Kx=DH       Au=RSA  Enc=DES(56)   Mac=SHA1
EDH-DSS-DES-CBC-SHA     SSLv3 Kx=DH       Au=DSS  Enc=DES(56)   Mac=SHA1
DES-CBC-SHA             SSLv3 Kx=RSA      Au=RSA  Enc=DES(56)   Mac=SHA1
EXP-EDH-RSA-DES-CBC-SHA SSLv3 Kx=DH(512)  Au=RSA  Enc=DES(40)   Mac=SHA1 export
EXP-EDH-DSS-DES-CBC-SHA SSLv3 Kx=DH(512)  Au=DSS  Enc=DES(40)   Mac=SHA1 export
EXP-DES-CBC-SHA         SSLv3 Kx=RSA(512) Au=RSA  Enc=DES(40)   Mac=SHA1 export
EXP-RC2-CBC-MD5         SSLv3 Kx=RSA(512) Au=RSA  Enc=RC2(40)   Mac=MD5  export
EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export

Also, I see it marked the EXP as EXPort and not EXPerimental. Maybe it's nothing related with your previous description?

My first goal is test that my server is able to answer to all ciphers that it list as supported. I don't want to have support for a cipher (based on SSL Labs check) if it doesn't work. So I will remove.

My goal is see if our benchmark may be better with different ciphers and if it will impact in our security compliance. Today we have a app (that send requests over HTTPS / SSL) to a webserver that host several applications (that has a mod_proxy and redirect to several different sub-servers), so this application check if each of this application is up, for how long, average time to reply, etc. This application is proprietary, no way to modify it. But, if this make the workaround easy, we may change the check points from https:// to http://, but the sites we are checking just have 443 port opened, so the proxy will have to handle this. The app is located in a network that has no direct access to the target web-server, so it pass over a proxy. All requests are sent over SSL, the actual proxy is a squid. What I need is a proxy that will allow me for example to forward all requests to the web-server but enforcing to use just a specific cipher. In this way, we will be able to benchmark the difference time based on cipher (the one at auto-negotiation) may be more slow. But, even if we find one that is faster we need to check with security team if it will be a problem for compliance.

Do you know a way to force the proxy to send all HTTPS request always with cipher X?

Thank you

Offline

#6 2011-02-15 09:27 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

It worked, but mine just have SSLv3, no one with TLS. Strange?

No, most of those SSLv3 ciphers will work just fine with TLSv1, too...  It's just calling them SSLv3 in the output there...  But, if, for instance, you were to do SSL_CIPHER_get_version() on most of them, they'd surely return "TLSv1/SSLv3"...  It just probably doesn't have the room in that particular output to list both...  Do "openssl ciphers -v -tls1", and it should show only ones that are compatible with TLSv1...  On my system, the only ones that are NOT compatible are SSLv2 ones (which you don't seem to have any of)...

Also, I see it marked the EXP as EXPort and not EXPerimental. Maybe it's nothing related with your previous description?

All I know is what I read in <openssl/tls1.h>:

/* Additional TLS ciphersuites from draft-ietf-tls-56-bit-ciphersuites-00.txt
 * (available if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see
 * s3_lib.c).  We actually treat them like SSL 3.0 ciphers, which we probably
 * shouldn't. */

Followed by those EXPORT ones like you tried to use...  So, it seems they are both for export AND experimental...  There do exist OTHER export ciphers which are always available, however...  Those in your list of ciphers are not the same as the one you initially talked about...  Like I said, that's "EXP1024-RC4-MD5"...

I'm not sure you really want to use export quality ciphers anyway; those will generally be much weaker and easier to crack...

Offline

#7 2011-02-17 03:07 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,230

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

As for speed, I don't think there's much difference between the "Au" ones.
(PSK is probably fastest and least convenient though...)

For the others, DES is slow, MD5 is insecure, so go for Enc=AES and Mac=SHA1.
You really want AES for encryption because that's the one with best hardware
support and also one of the fastest in software.

But to test the speed difference just run "openssl speed".

Offline

#8 2011-02-18 05:17 PM

RM
Member
Registered: 2010-10-22
Posts: 9

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

Hi RobSeace and i386,

Thanks, your comments were very appreciated and valuable. Now it's more clear to me.

Any idea about the second question (proxy enforcing cipher type)? Or do you think there is no software built for this?

Thanks

Offline

#9 2011-02-18 07:39 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,829
Website

Re: OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

I know nothing about it, but you mentioned you were using squid, right?  Well, I find this page in the docs, that looks like it lets you set the list of ciphers to use...

Offline

  • Index
  • » General
  • » OpenSSL why EXP ciphers doesn't work? + force cipher in proxy?

Board footer

Powered by FluxBB