noxxi / p5-io-socket-ssl

IO::Socket::SSL Perl Module
36 stars 60 forks source link

Make tests pass in a FreeBSD jail #9

Closed tomhukins closed 10 years ago

tomhukins commented 10 years ago

FreeBSD jails do not use 127.0.0.1 as a loopback address.

noxxi commented 10 years ago

What address uses FreeBSD then inside jails? I would rather check against a useful value instead of just disabling the check. Also, the test server in this and other tests explicitly listens to 127.0.0.1 (and only to this address), so this address must be at least available inside the jail (but maybe not as the primary address on loopback interface ?)

tomhukins commented 10 years ago

Hi, Steffen. Thank you for your prompt reply.

On Wed, Jan 15, 2014 at 02:30:39PM -0800, Steffen Ullrich wrote:

What address uses FreeBSD then inside jails.

Each jail has its own IP address, but not the conventional loopback address.

I would rather check against a useful value instead of just disabling the check.

That sounds sensible. I can't think of a way to do this, however.

Also, the test server in this and other tests explicitly listens to 127.0.0.1 (and only to this address), so this address must be at least available inside the jail (but maybe not as the primary address on loopback interface ?)

Yes, conventionally, but not in a jail. Processes running within a jail can bind to 127.0.0.1 but FreeBSD automatically translates this to the jail's IP address.

Tom

noxxi commented 10 years ago

The issue should be hopefully fixed with the latest release. I now check using a normal INET socket which peer address to expect, instead of using fixed 127.0.0.1