sakurashinken
sakurashinken

Reputation: 4080

How to set cyphers for imaplib with gmail?

I am using imap with gmail, and I am using the ssl.create_default_context() method to set up the SSL connection. I was wondering how I can

  1. check what cypher is being used on a given connection started with the IMAP4_SSL constructor

  2. ensure that only cyphers from TLSv1.2 or higher are being used.

Upvotes: 0

Views: 24

Answers (1)

sakurashinken
sakurashinken

Reputation: 4080

I'll post what I found to help others doing the same thing. It seems the easiest way to examine the connection is to do packet inspection in wireshark. I followed the steps in this tutorial. Basically, call ping on your imap server, then put ip.addr == as a filter and run your script. Look for the "server hello" tls packet in the list of activity to find the negotiated cypher and protocol version.

Upvotes: 0

Related Questions