0

So, I have to test that client that connects to an HTTPS server, and ensure it offer the listed cyphersuites during the tls handshake.

But I'm finding no way to start a server and have it tell me what cyphersuites the client offers, as all the servers software I have been using are totally abstracting TLS.

Actually, I did not find any software that can act as a server (meaning my client can connect to) and that tells me what cyphersuite the client is offering.

I've tried using an https python based on openSSL and found no way to get that info out of openSSL. I've tried using twisted and had the same result

How would you test such a thing ?

1 Answer 1

-2

To list the cyphers offered by a TLS client, you can use the following steps:

  1. Use a network analyzer tool like Wireshark to capture the network traffic between the client and the server.
  2. Filter the captured traffic to show only the SSL/TLS packets.
  3. Examine the Client Hello message, which is the first message sent by the client in the SSL/TLS handshake process.
  4. The Client Hello message includes a list of supported cypher suites.

Alternatively, you can also use a code-based approach:

  1. Use the OpenSSL library to establish a connection between the client and the server.
  2. Call the SSL_get_ciphers() function to retrieve a list of supported cypher suites.
  3. Print out the result of the SSL_get_ciphers() function.

Note: You will need to have access to the source code of the client to use the code-based approach.


To test the list of cipher suites offered by a client during the TLS handshake, you can use tools such as OpenSSL, sslyze, nmap, or Wireshark to intercept the TLS handshake and inspect the cipher suites being offered by the client.

1 OpenSSL: You can use the openssl command-line tool to test the available cipher suites offered by a client during the TLS handshake with a server. You can run the following command:

openssl s_client -connect <host>:<port> -cipher <ciphersuite>

Where <host> and <port> are the hostname and port number of the server you want to connect to, and is the specific cipher suite you want to test.

2 sslyze: sslyze is a command-line tool that can be used to scan an SSL/TLS service to check its configuration and vulnerabilities. To test the available cipher suites offered by a client, run the following command:

sslyze --regular <host>:<port>

Where <host> and <port> are the hostname and port number of the server you want to connect to.

3 Nmap: Nmap is a popular network mapping tool that can also be used to scan for SSL/TLS information. To test the available cipher suites offered by a client, run the following command:

nmap --script ssl-enum-ciphers <host>:<port>

Where <host> and <port> are the hostname and port number of the server you want to connect to.

4 Wireshark: Wireshark is a popular network protocol analyzer that can be used to inspect the details of a TLS handshake. To inspect the available cipher suites offered by a client, start Wireshark and capture network traffic to the server, then filter for TLS packets and inspect the Handshake Protocol section to see the list of cipher suites offered by the client.


To test the client's offered cipher suites during a TLS handshake, you can use a tool like OpenSSL to set up a mock HTTPS server and capture the client's cipher suite request.

Here's a high-level overview of the steps to follow:

  1. Install OpenSSL on your system.

  2. Start the OpenSSL server in listening mode, using a command like this:

openssl s_server -accept -key <private_key> -cert -cipher <cipher_suite>

where <port> is the port you want the server to listen on, <private_key> is the path to the private key file, <certificate> is the path to the certificate file, and <cipher_suite> is the specific cipher suite you want to test.

  1. Connect to the OpenSSL server from the client and initiate a TLS handshake.

  2. Use the -debug option in the OpenSSL server command to capture the client's cipher suite request during the handshake.

  3. Analyze the output to confirm that the client is offering the expected cipher suite(s).

Note that this is just a basic example and there are other tools and methods you could use for this kind of testing, depending on your specific needs and constraints.

You can use a network protocol analyzer tool, such as Wireshark, to monitor the TLS handshake between the client and the server. Wireshark can capture the packets exchanged between the two parties and show you the details of the SSL/TLS Handshake, including the list of cipher suites offered by the client.

Another option is to set up a custom HTTPS server using a programming language or library that allows you to inspect the SSL/TLS Handshake, such as Python's ssl library, which provides low-level access to the underlying SSL/TLS protocols.

You can use this custom HTTPS server to simulate the production server and log the cipher suites offered by the client during the handshake. Then you can write test cases to verify that the client is offering the expected cipher suites.

It's important to note that you may also want to perform other tests, such as verifying the client's certificate validation, to ensure that the client is securely connecting to the server.

6
  • 1
    thank you ChatGPT, but not that helpful at all
    – Spoutnik16
    Feb 1 at 7:38
  • If you can give more details like what you have tried and what errors it resulted in, then may be people can help you resolve specific issues. More generalised questions will always have a generalised asnwer. Feb 1 at 8:42
  • Actually, I did not find any software that can act as a server (meaning my client can connect to) and that tells me what cyphersuite the client is offering. None of your solution can have a client connect to them. I've added info to the question.
    – Spoutnik16
    Feb 1 at 10:46
  • The last sentance : "It's important to note that you may also want to perform other tests, such as verifying the client's certificate validation, to ensure that the client is securely connecting to the server." Don't you dare tell that this thing is not out of ChatGPT :-)
    – Spoutnik16
    Feb 1 at 10:50
  • 1
    Unfortunately, writer.com/ai-content-detector agrees about this answer being largely generated by AI. The answer also fails to address the key point of the question: namely, how can the OP programmatically and have the client retrieve the full list of supported cipher suites to compare against the master list.
    – Kate Paulk
    Feb 1 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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