Bryan O'Sullivan avatar Bryan O'Sullivan committed 6f5e1e7

SSL cipher info.

Comments (0)

Files changed (2)

Database/MySQL.hs

     , hostInfo
     , protocolInfo
     , characterSetName
+    , sslCipher
     -- * General information
     , clientInfo
     , clientVersion
 characterSetName conn = withConn conn $ \ptr ->
                         peekCString =<< mysql_character_set_name ptr
 
+sslCipher :: Connection -> IO (Maybe String)
+sslCipher conn = withConn conn $ \ptr -> do
+  name <- mysql_get_ssl_cipher ptr
+  if name == nullPtr
+    then return Nothing
+    else Just <$> peekCString name
+
 clientInfo :: String
 clientInfo = unsafePerformIO $ peekCString mysql_get_client_info
 {-# NOINLINE clientInfo #-}

Database/MySQL/C.hsc

     , mysql_get_host_info
     , mysql_get_proto_info
     , mysql_character_set_name
+    , mysql_get_ssl_cipher
     -- * General information
     , mysql_get_client_info
     , mysql_get_client_version
 foreign import ccall safe mysql_character_set_name
     :: Ptr MYSQL -> IO CString
 
+foreign import ccall safe mysql_get_ssl_cipher
+    :: Ptr MYSQL -> IO CString
+
 foreign import ccall safe mysql_get_client_info :: CString
 
 foreign import ccall safe mysql_get_client_version :: CULong
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.