Skip to content
  • Thomas Rast's avatar
    send-email: set SSL options through IO::Socket::SSL::set_client_defaults · 5508f3ed
    Thomas Rast authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When --smtp-encryption=ssl, we use a Net::SMTP::SSL connection,
    passing its ->new all the options that would otherwise go to
    Net::SMTP->new (most options) and IO::Socket::SSL->start_SSL (for the
    SSL options).
    
    However, while Net::SMTP::SSL replaces the underlying socket class
    with an SSL socket, it does nothing to allow passing options to that
    socket.  So the SSL-relevant options are lost.
    
    Fortunately there is an escape hatch: we can directly set the options
    with IO::Socket::SSL::set_client_defaults.  They will then persist
    within the IO::Socket::SSL module.
    
    Signed-off-by: default avatarThomas Rast <tr@thomasrast.ch>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    5508f3ed