3

I installed OpenSSL locally and used s_server command to start a server by using self signed certificate created by OpenSSL as well.

The command I used to start a https server is OpenSSL> s_server -accept 443 -www -cert c:\temp\test_server.crt -key c:\temp\test_server.key. I pointed my own browser to it and I can see a list of supported ciphers from server, and selected ciphers (Ciphers common between both SSL end points).

I am just curious is there a way to display the preferred cipher list sent by browser?

2

Use "-brief"

You need to use the -brief command line option:

$ openssl s_server -accept 443 -cert cacert.pem -key cakey.pem -brief

Output:

Protocol version: TLSv1.2
Client cipher list: ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:0xCC14:0xCC13:0xCC15:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:SCSV
Ciphersuite: ECDHE-RSA-AES128-GCM-SHA256
Signature Algorithms: RSA+SHA512:ECDSA+SHA512:RSA+SHA384:ECDSA+SHA384:RSA+SHA256:ECDSA+SHA256:RSA+SHA224:ECDSA+SHA224:RSA+SHA1:ECDSA+SHA1
No peer certificate
Supported Elliptic Curve Point Formats: uncompressed
Supported Elliptic Curves: P-256:P-384
Protocol version: TLSv1.2
Client cipher list: ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:0xCC14:0xCC13:0xCC15:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:SCSV
Ciphersuite: ECDHE-RSA-AES128-GCM-SHA256
Signature Algorithms: RSA+SHA512:ECDSA+SHA512:RSA+SHA384:ECDSA+SHA384:RSA+SHA256:ECDSA+SHA256:RSA+SHA224:ECDSA+SHA224:RSA+SHA1:ECDSA+SHA1
No peer certificate
Supported Elliptic Curve Point Formats: uncompressed
Supported Elliptic Curves: P-256:P-384
GET / HTTP/1.1
Host: localhost
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36
DNT: 1
Accept-Encoding: gzip, deflate, sdch

Note: "-brief" does not in fact mean "brief"

The Client cipher list: line is NOT displayed when leave out the -brief option.

Unfortunately the s_server documentation provides only wrong/misleading information about this parameter:

-brief  
  only provide a brief summary of connection parameters instead of the normal verbose output.

Yes, that's right, in order to get more info, you need to use the "give me less info" parameter. (OpenSSL is quirky with its command line options that way.)

Further reading

There was thread about this on the OpenSSL mailing list and a developer provided the information about the -brief parameter:

0

I'm not sure if this is exactly what you're looking for but s_server will send the full list of ciphers as well as common ciphers shared between the endpoints when you try to access the server:

openssl s_server -accept 443 -www -cert /etc/ssl/certs/server.crt -key /etc/ssl/private/server.key

This is the data sent to the client (Firefox, in this case):

s_server -accept 443 -www -cert /etc/ssl/certs/server.crt -key /etc/ssl/private/server.key -state 
Secure Renegotiation IS supported
Ciphers supported in s_server binary
TLSv1/SSLv3:ECDHE-RSA-AES256-GCM-SHA384TLSv1/SSLv3:ECDHE-ECDSA-AES256-GCM-SHA384
TLSv1/SSLv3:ECDHE-RSA-AES256-SHA384  TLSv1/SSLv3:ECDHE-ECDSA-AES256-SHA384
TLSv1/SSLv3:ECDHE-RSA-AES256-SHA     TLSv1/SSLv3:ECDHE-ECDSA-AES256-SHA   
TLSv1/SSLv3:SRP-DSS-AES-256-CBC-SHA  TLSv1/SSLv3:SRP-RSA-AES-256-CBC-SHA  
TLSv1/SSLv3:DHE-DSS-AES256-GCM-SHA384TLSv1/SSLv3:DHE-RSA-AES256-GCM-SHA384
TLSv1/SSLv3:DHE-RSA-AES256-SHA256    TLSv1/SSLv3:DHE-DSS-AES256-SHA256    
TLSv1/SSLv3:DHE-RSA-AES256-SHA       TLSv1/SSLv3:DHE-DSS-AES256-SHA       
TLSv1/SSLv3:DHE-RSA-CAMELLIA256-SHA  TLSv1/SSLv3:DHE-DSS-CAMELLIA256-SHA  
TLSv1/SSLv3:ECDH-RSA-AES256-GCM-SHA384TLSv1/SSLv3:ECDH-ECDSA-AES256-GCM-SHA384
TLSv1/SSLv3:ECDH-RSA-AES256-SHA384   TLSv1/SSLv3:ECDH-ECDSA-AES256-SHA384 
TLSv1/SSLv3:ECDH-RSA-AES256-SHA      TLSv1/SSLv3:ECDH-ECDSA-AES256-SHA    
TLSv1/SSLv3:AES256-GCM-SHA384        TLSv1/SSLv3:AES256-SHA256            
TLSv1/SSLv3:AES256-SHA               TLSv1/SSLv3:CAMELLIA256-SHA          
TLSv1/SSLv3:PSK-AES256-CBC-SHA       TLSv1/SSLv3:ECDHE-RSA-DES-CBC3-SHA   
TLSv1/SSLv3:ECDHE-ECDSA-DES-CBC3-SHA TLSv1/SSLv3:SRP-DSS-3DES-EDE-CBC-SHA 
TLSv1/SSLv3:SRP-RSA-3DES-EDE-CBC-SHA TLSv1/SSLv3:EDH-RSA-DES-CBC3-SHA     
TLSv1/SSLv3:EDH-DSS-DES-CBC3-SHA     TLSv1/SSLv3:ECDH-RSA-DES-CBC3-SHA    
TLSv1/SSLv3:ECDH-ECDSA-DES-CBC3-SHA  TLSv1/SSLv3:DES-CBC3-SHA             
TLSv1/SSLv3:PSK-3DES-EDE-CBC-SHA     TLSv1/SSLv3:ECDHE-RSA-AES128-GCM-SHA256
TLSv1/SSLv3:ECDHE-ECDSA-AES128-GCM-SHA256TLSv1/SSLv3:ECDHE-RSA-AES128-SHA256  
TLSv1/SSLv3:ECDHE-ECDSA-AES128-SHA256TLSv1/SSLv3:ECDHE-RSA-AES128-SHA     
TLSv1/SSLv3:ECDHE-ECDSA-AES128-SHA   TLSv1/SSLv3:SRP-DSS-AES-128-CBC-SHA  
TLSv1/SSLv3:SRP-RSA-AES-128-CBC-SHA  TLSv1/SSLv3:DHE-DSS-AES128-GCM-SHA256
TLSv1/SSLv3:DHE-RSA-AES128-GCM-SHA256TLSv1/SSLv3:DHE-RSA-AES128-SHA256    
TLSv1/SSLv3:DHE-DSS-AES128-SHA256    TLSv1/SSLv3:DHE-RSA-AES128-SHA       
TLSv1/SSLv3:DHE-DSS-AES128-SHA       TLSv1/SSLv3:DHE-RSA-SEED-SHA         
TLSv1/SSLv3:DHE-DSS-SEED-SHA         TLSv1/SSLv3:DHE-RSA-CAMELLIA128-SHA  
TLSv1/SSLv3:DHE-DSS-CAMELLIA128-SHA  TLSv1/SSLv3:ECDH-RSA-AES128-GCM-SHA256
TLSv1/SSLv3:ECDH-ECDSA-AES128-GCM-SHA256TLSv1/SSLv3:ECDH-RSA-AES128-SHA256   
TLSv1/SSLv3:ECDH-ECDSA-AES128-SHA256 TLSv1/SSLv3:ECDH-RSA-AES128-SHA      
TLSv1/SSLv3:ECDH-ECDSA-AES128-SHA    TLSv1/SSLv3:AES128-GCM-SHA256        
TLSv1/SSLv3:AES128-SHA256            TLSv1/SSLv3:AES128-SHA               
TLSv1/SSLv3:SEED-SHA                 TLSv1/SSLv3:CAMELLIA128-SHA          
TLSv1/SSLv3:PSK-AES128-CBC-SHA       TLSv1/SSLv3:ECDHE-RSA-RC4-SHA        
TLSv1/SSLv3:ECDHE-ECDSA-RC4-SHA      TLSv1/SSLv3:ECDH-RSA-RC4-SHA         
TLSv1/SSLv3:ECDH-ECDSA-RC4-SHA       TLSv1/SSLv3:RC4-SHA                  
TLSv1/SSLv3:RC4-MD5                  TLSv1/SSLv3:PSK-RC4-SHA              
TLSv1/SSLv3:EDH-RSA-DES-CBC-SHA      TLSv1/SSLv3:EDH-DSS-DES-CBC-SHA      
TLSv1/SSLv3:DES-CBC-SHA              TLSv1/SSLv3:EXP-EDH-RSA-DES-CBC-SHA  
TLSv1/SSLv3:EXP-EDH-DSS-DES-CBC-SHA  TLSv1/SSLv3:EXP-DES-CBC-SHA          
TLSv1/SSLv3:EXP-RC2-CBC-MD5          TLSv1/SSLv3:EXP-RC4-MD5              
---
Ciphers common between both SSL end points:
ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES256-SHA    
ECDHE-ECDSA-AES128-SHA     ECDHE-RSA-AES128-SHA       ECDHE-RSA-AES256-SHA      
ECDHE-RSA-DES-CBC3-SHA     ECDHE-ECDSA-RC4-SHA        ECDHE-RSA-RC4-SHA         
DHE-RSA-AES128-SHA         DHE-DSS-AES128-SHA         DHE-RSA-CAMELLIA128-SHA   
DHE-RSA-AES256-SHA         DHE-DSS-AES256-SHA         DHE-RSA-CAMELLIA256-SHA   
EDH-RSA-DES-CBC3-SHA       AES128-SHA                 CAMELLIA128-SHA           
AES256-SHA                 CAMELLIA256-SHA            DES-CBC3-SHA              
RC4-SHA                    RC4-MD5
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 
    Session-ID-ctx: 01000000
    Master-Key: 73D6284EC854886CA04376CD40FD7BFF784FA36CDD0212B528803FEA9976679561721E6439D2CA8344BE5E1C74C5F69A
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1407868267
    Timeout   : 300 (sec)
    Verify return code: 0 (ok)
---
   0 items in the session cache
   0 client connects (SSL_connect())
   0 client renegotiates (SSL_connect())
   0 client connects that finished
   5 server accepts (SSL_accept())
   0 server renegotiates (SSL_accept())
   5 server accepts that finished
   0 session cache hits
   0 session cache misses
   0 session cache timeouts
   0 callback cache hits
   0 cache full overflows (128 allowed)
---
no client certificate available
  • In what circumstance does the Server send a list of cipher suites to the client? I thought the server picked one from the client hello (or reject them all). – RoraΖ Aug 12 '14 at 18:47
  • OpenSSL's s_server is a test server and it sends the cipher list above to the client as HTTP data, not as part of the protocol itself. – Bryan Geraghty Aug 12 '14 at 18:51
  • Ah ok, I don't have to much experience using s_server. Good to know. – RoraΖ Aug 12 '14 at 18:59
  • This is what I see, but the list does not list what browser has provided. – hardywang Aug 12 '14 at 19:58
  • 1
    OpenSSL implements nearly all standard ciphersuites (although very weak ones are disabled by default, and RedHat builds through 2013 removed ECC), so the "common list" will usually be the same or nearly the same as the client offered. But if you want to know exactly, -msg will display the handshake messages in hex; ClientHello message can be decoded fairly easily to give the offered cipher list, and also other interesting info like the offered protocol range, EC curves and formats, signature algos for TLSv1.2, etc. – dave_thompson_085 Aug 15 '14 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.