Overview:
- Between the two ends points of a communication which is connection oriented the TLS protocol provides privacy, message integrity and authentication services.
- The instance method cipher() of the SSLSocket class returns the following information as a tuple
- The cipher (i.e, The cryptographic methodology) used for the communication
- The version of the TLS (also still called as SSL) protocol
- Number of secret bits used
Example:
# Example Python program that gets the cipher information
# Check for OS X platform # Load the CA certificates used for validating the peer's certificate # Make a secure socket to connect to the server # Connect to the server print("Name of the cipher:%s"%cipher[0]) print("Number of secret bits:%s"%cipher[2]) |
Output:
Name of the cipher:TLS_AES_256_GCM_SHA384 |