MCPcopy Create free account
hub / github.com/apache/cloudberry / printSSLInfo

Function printSSLInfo

src/bin/psql/command.c:3600–3621  ·  view source on GitHub ↗

* printSSLInfo * * Prints information about the current SSL connection, if SSL is in use */

Source from the content-addressed store, hash-verified

3598 * Prints information about the current SSL connection, if SSL is in use
3599 */
3600static void
3601printSSLInfo(void)
3602{
3603 const char *protocol;
3604 const char *cipher;
3605 const char *bits;
3606 const char *compression;
3607
3608 if (!PQsslInUse(pset.db))
3609 return; /* no SSL */
3610
3611 protocol = PQsslAttribute(pset.db, "protocol");
3612 cipher = PQsslAttribute(pset.db, "cipher");
3613 bits = PQsslAttribute(pset.db, "key_bits");
3614 compression = PQsslAttribute(pset.db, "compression");
3615
3616 printf(_("SSL connection (protocol: %s, cipher: %s, bits: %s, compression: %s)\n"),
3617 protocol ? protocol : _("unknown"),
3618 cipher ? cipher : _("unknown"),
3619 bits ? bits : _("unknown"),
3620 (compression && strcmp(compression, "off") != 0) ? _("on") : _("off"));
3621}
3622
3623/*
3624 * printGSSInfo

Callers 2

exec_command_conninfoFunction · 0.85
connection_warningsFunction · 0.85

Calls 2

PQsslInUseFunction · 0.85
PQsslAttributeFunction · 0.50

Tested by

no test coverage detected