Description: Set the name which is used in verification of hostname.
Origin: vendor
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=164994
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=164994
Bug-Debian: https://bugs.debian.org/1104296
Author: Peter Palfrader <weasel@debian.org>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2025-05-07

--- a/lib/Net/SMTP/TLS.pm
+++ b/lib/Net/SMTP/TLS.pm
@@ -178,7 +178,7 @@
 	if(not $num == 220){
 		croak "Invalid response for STARTTLS: $num $txt\n";
 	}
-	if(not IO::Socket::SSL::socket_to_SSL($me->{sock})){
+	if(not IO::Socket::SSL::socket_to_SSL($me->{sock}, SSL_verifycn_name => $me->{Host})){
 			croak "Couldn't start TLS: ".IO::Socket::SSL::errstr."\n";
 	}
 	$me->hello();
