aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-12-11 16:23:12 +0100
committerGuilhem Moulin <guilhem@fripost.org>2020-12-11 18:32:43 +0100
commit35f4ecefa9c9ff55acfdb337b215e3d13345c86d (patch)
treed74e3c5095dad75f55c2713175bda3d86f864b9c
parent7d7a28bc77908d05983a3c3fcfed79616a1614ce (diff)
libinterimap: use Net::SSLeay::get_version() to get the protocol version string.
This avoids maintaing our own map.
-rw-r--r--Changelog2
-rw-r--r--lib/Net/IMAP/InterIMAP.pm12
2 files changed, 5 insertions, 9 deletions
diff --git a/Changelog b/Changelog
index d880a0f..83dea70 100644
--- a/Changelog
+++ b/Changelog
@@ -6,6 +6,8 @@ interimap (0.5.5) upstream;
the system default provides better compatibility with future libssl
versions.
- libinterimap: make $OPENSSL_VERSION global.
+ - libinterimap: use Net::SSLeay::get_version() to get the protocol
+ version string.
-- Guilhem Moulin <guilhem@fripost.org> Fri, 11 Dec 2020 14:55:53 +0100
diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
index 5843b27..e2b89ec 100644
--- a/lib/Net/IMAP/InterIMAP.pm
+++ b/lib/Net/IMAP/InterIMAP.pm
@@ -1789,15 +1789,9 @@ sub _start_ssl($$) {
Net::SSLeay::X509_VERIFY_PARAM_free($vpm);
if ($self->{debug}) {
- my $v = Net::SSLeay::version($ssl);
- $self->log(sprintf('SSL protocol: %s (0x%x)', ($v == 0x0002 ? 'SSLv2' :
- $v == 0x0300 ? 'SSLv3' :
- $v == 0x0301 ? 'TLSv1' :
- $v == 0x0302 ? 'TLSv1.1' :
- $v == 0x0303 ? 'TLSv1.2' :
- $v == 0x0304 ? 'TLSv1.3' :
- '??'),
- $v));
+ $self->log(sprintf('SSL protocol: %s (0x%x)',
+ , Net::SSLeay::get_version($ssl)
+ , Net::SSLeay::version($ssl)));
$self->log(sprintf('SSL cipher: %s (%d bits)'
, Net::SSLeay::get_cipher($ssl)
, Net::SSLeay::get_cipher_bits($ssl)));