* printSSLInfo * * Prints information about the current SSL connection, if SSL is in use */
| 3598 | * Prints information about the current SSL connection, if SSL is in use |
| 3599 | */ |
| 3600 | static void |
| 3601 | printSSLInfo(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 |
no test coverage detected