SSL testing and/or remote access

139 views
Skip to first unread message

Thibaut Barrère

unread,
Jan 16, 2012, 7:40:48 AM1/16/12
to vagra...@googlegroups.com
Hello folks,

I had the need to connect to a SSL-only vagrant-based server from other machines on the network (eg: iPhone).  Here's some feedback in case it's helpful to others (given that most new apps are fully ssl these days)!

Maybe that's worth adding to the Vagrant docs, not sure? Let me know and I'll provide a patch.

without host only mode

In this mode you can setup some port forwarding for ssl:

config.vm.forward_port "https", 443, 8081

then you can access the app using the non standard port (here on a mac):


One extra trick can remove the need to change the port (useful if you app send email or notifications with links to the vagrant app), here on mac os x:

sudo ipfw add 8081 forward 127.0.0.1,8081 ip from any to any 443 in
# later to remove
sudo sudo ipfw delete 8081

From then you should be able to access the app on the standard port:


host only mode

In this mode you'll be able to access the app from the host (but not from other machines on the network afaik). I tend to stick the IP in /etc/hosts then:


Voilà - hope this helps,

-- Thibaut

Mitchell Hashimoto

unread,
Jan 16, 2012, 12:16:09 PM1/16/12
to vagra...@googlegroups.com
Thibaut,

Also, in the next release of Vagrant (0.9.0), you can use bridged networking:

config.vm.network :bridged

This will cause your VM to appear as a physical device on your network, with its own IP that you can use to access HTTPS directly by any other device (such as an iPhone) on your network, so long as your networking permissions allow it.

Mitchell
 
-- Thibaut

Thibaut Barrère

unread,
Jan 16, 2012, 2:13:52 PM1/16/12
to vagra...@googlegroups.com
Hi,

Also, in the next release of Vagrant (0.9.0), you can use bridged networking:

config.vm.network :bridged

This will cause your VM to appear as a physical device on your network, with its own IP that you can use to access HTTPS directly by any other device (such as an iPhone) on your network, so long as your networking permissions allow it.

I planned to test out 0.9.0 tomorrow so that's good to hear :)

Thanks for letting me know!

-- Thibaut 
Reply all
Reply to author
Forward
0 new messages