Thursday, August 6, 2009

Local machine, hostname, ssl / https would hang

I am trying to put lessons I've investigated and learnt up, not only as a record for myself, but also to help others. The web has solved so many of my problems and I want to pass on anything i know that can help.

I am a Mac user (Mac Mini running Mac OS X 10.5.7 currently).

I run JSPWiki WebApp through the Tomcat server and have the security policy set to https (SSL) for logins and editing. My server is kanga.local (Bonjour) and it has the IP address of 10.0.1.5.

When I connect from any other local machine I'd log in straight away (go to http address and 'login' and 'pw' form would come up immediately). When I connected to it via the server using the server name (kanga.local) the browser would sit there saying "connecting to kanga.local" and sometimes eventually got there to the login screen (over https). It was unusable like this. If I put in localhost instead it would get to the login screen but logging in (post OK) then would revert to kanga.local and once again it would take forever.



Things I tried to work out what was going on (aswell as Google):
  • dscacheutil (Directory Services) showed me that Kanga.local had multiple IP addresses

bsmith@kanga RCS $ dscacheutil -q host -a name kanga.local
name: kanga.local
ipv6_address: fe80:8::21c:42ff:fe00:9
ipv6_address: fe80:8::225:ff:fef8:3034

name: kanga.local
ip_address: 10.37.129.2
ip_address: 10.211.55.2
ip_address: 10.0.1.5

  • traceroute - returned a result instantly and showed it took 1 hop so didn't help me at all

bsmith@kanga RCS $ traceroute -p 8443 kanga.local
traceroute to kanga.local (10.0.1.5), 64 hops max, 40 byte packets
1 10.0.1.5 (10.0.1.5) 0.403 ms 0.057 ms 0.081 ms


bsmith@kanga RCS $ ifconfig
lo0: flags=8049 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
gif0: flags=8010 mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863 mtu 1500
ether 00:25:4b:b3:d6:20
media: autoselect status: inactive
supported media: none autoselect 10baseT/UTP 10baseT/UTP 10baseT/UTP 10baseT/UTP 100baseTX 100baseTX 100baseTX 100baseTX 1000baseT 1000baseT 1000baseT
en1: flags=8863 mtu 1500
inet6 fe80::225:ff:fef8:3034%en1 prefixlen 64 scopeid 0x5
inet 10.0.1.5 netmask 0xffffff00 broadcast 10.0.1.255
ether 00:25:00:f8:30:34
media: autoselect status: active
supported media: autoselect
fw0: flags=8863 mtu 4078
lladdr 00:25:4b:ff:fe:b3:d6:20
media: autoselect status: inactive
supported media: autoselect
en2: flags=8963 mtu 1500
inet6 fe80::21c:42ff:fe00:8%en2 prefixlen 64 scopeid 0x7
inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255
ether 00:1c:42:00:00:08
media: autoselect status: active
supported media: autoselect
en3: flags=8963 mtu 1500
inet6 fe80::21c:42ff:fe00:9%en3 prefixlen 64 scopeid 0x8
inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255
ether 00:1c:42:00:00:09
media: autoselect status: active
supported media: autoselect


  • iStat Menus is a system monitoring tool that shows Network Interfaces. I noticed that it shows the interfaces that ifconfig shows. And when I bring an interface down it can no longer be seen in the iStat menu.

What I wondered was why the Network System Preference didn't do the same as ifconfig. Then I realised it does!. This would have saved me alot of time if I'd realised it.

Go to Network Preferences and you'll see listed down the left-hand, what are ultimately network interfaces. This picture shows the en2 interface active:




Now select the interface you want to turn off and select 'off' in the Configure drop-down.

And it will be disabled. It seems to take a couple minutes to ripple through the system. And I had to close the current Firefox tab and open a new one.



If this doesn't work then you'll need to use ifconfig to turn off the network interfaces as per Disable your network interfaces (Mac Tricks and Tips blog):


sudo ifconfig en2 down
sudo ifconfig en3 down