Project

General

Profile

Actions

Bug #14822

closed

[POP3/SSL] net/protocol.rb:44: warning: verify_hostname requires hostname to be set

Added by hkamphor (Jos Kamphorst) almost 6 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:87390]

Description

When enabling SSL with POP3 like this:

require 'net/pop'

Net::POP.enable_ssl
Net::POP3.start(...) |pop|
...

A warning like this will be generated:
net/protocol.rb:44: warning: verify_hostname requires hostname to be set

This happens because SSLContext default is :verify_hostname => true.

The attached patch fixes this by setting the SSLSocket#hostname variable to the address which is given during Net::POP3.start.


Files

pop_ssl_verify_hostname.patch (881 Bytes) pop_ssl_verify_hostname.patch hkamphor (Jos Kamphorst), 06/04/2018 04:23 PM

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

I can reproduce this issue, and have confirmed your fix removes the warning. It would have been helpful to mention that this warning is only printed in verbose mode. :)

Actions #2

Updated by jeremyevans (Jeremy Evans) almost 5 years ago

  • Status changed from Open to Closed

Applied in changeset git|4a5e07d8e17a0f62810f983114a88cb1011f971b.


Avoid verbose warning when using Net::POP3 with SSL

Patch from Jos Kamphorst.

Fixes [Bug #14822]

Actions

Also available in: Atom PDF

Like0
Like0Like0