MCPcopy Create free account
hub / github.com/dbcli/mycli / get_ssl_version

Function get_ssl_version

mycli/packages/special/utils.py:93–114  ·  view source on GitHub ↗
(cur: Cursor)

Source from the content-addressed store, hash-verified

91
92
93def get_ssl_version(cur: Cursor) -> str | None:
94 cache_key = (id(cur.connection), cur.connection.thread_id())
95
96 if cache_key in CACHED_SSL_VERSION:
97 return CACHED_SSL_VERSION[cache_key] or None
98
99 query = 'SHOW STATUS LIKE "Ssl_version"'
100 logger.debug(query)
101
102 ssl_version = None
103
104 try:
105 cur.execute(query)
106 if one := cur.fetchone():
107 CACHED_SSL_VERSION[cache_key] = one[1]
108 ssl_version = one[1] or None
109 else:
110 CACHED_SSL_VERSION[cache_key] = ''
111 except pymysql.err.OperationalError:
112 pass
113
114 return ssl_version
115
116
117def get_ssl_cipher(cur: Cursor) -> str | None:

Calls 4

thread_idMethod · 0.80
debugMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45