Vagrant Share not working with HTTPS

343 views
Skip to first unread message

Jen Duncan

unread,
Sep 28, 2016, 3:42:58 PM9/28/16
to Vagrant
Hi! 

So, first off, please forgive me because I am a big newbie with vagrant!

I'm trying to change a current site that we have info a mobile first site.  To adequately develop and test I need to be able to see whats on my vagrant box (that lives on my laptop) on my phone to ensure it looks right before deploying the site to our customer's site.

From what I can tell, I should be able to do this with vagrant share. 

After using the vagrant share command, I get a URL and I can get the site to come up on my phone, BUT I can not log in to it because it is http, not https.  I get an error on Firefox saying :'Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen."  How can I get a share set up using https?  I've included my vagrantfile.   Thank you so much in advance for any help you can offer me!

Vagrant File:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION
= "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config
.vm.box = "bento/ubuntu-16.04"
  config
.vm.provision :shell, path: "scripts/bootstrap.sh"
  config
.vm.hostname = "mysite.dev"
  config
.vm.network "forwarded_port", guest: 80, host: 8080
 
## create a private network visible only to the host machine
 
#config.vm.network :private_network, ip: "127.0.0.1"
  config
.vm.network :private_network, ip: "192.168.99.130"
  config
.vm.synced_folder "./mysite", "/var/lib/mysite/mysite_cloud"

 
# Example of share an additional folder to the guest VM.
  config
.vm.provider :virtualbox do |vb|
    vb
.customize ["modifyvm", :id, "--memory", "4096", "--cpus", "4"]
 
end
 
end

output from elevated prompt doing vagrant share:
==> default: Detecting network information for machine...
    default: Local machine address: 192.168.99.130
    default: Local HTTP port: 80
    default: Local HTTPS port: disabled
==> default: Checking authentication and authorization...
==> default: Creating Vagrant Share session...
    default: Share will be at: late-silver-1382
==> default: Your Vagrant Share is running! Name: late-silver-1382
==> default: URL: http://late-silver-1382.vagrantshare.com

Alvaro Miranda Aguilera

unread,
Sep 29, 2016, 12:43:43 PM9/29/16
to vagra...@googlegroups.com

On Wed, Sep 28, 2016 at 9:42 PM, Jen Duncan <jend...@gmail.com> wrote:
  config.vm.network "forwarded_port", guest: 80, host: 8080

hello

add a new port that goes to guest: 443

  config.vm.network "forwarded_port", guest: 443, host: 4443

Alvaro


--
Alvaro

Jen Duncan

unread,
Oct 3, 2016, 9:49:04 AM10/3/16
to Vagrant
Putting the 443 port in my vagrant file is not solving my issue either.

Vagrant Share will work but only with http, if I try and put a "HTTPS" in front of the link, the site says: 

Failed to connect to Vagrant Share

This sharing session doesn't allow HTTPS requests. This may be resolved by simply removing the s from thehttps:// section of this url if you are comfortable with sending this request in plain text. If you are unable to do so, you should contact the creator of the sharing session and let them know you are not able to access the VM over SSL/TLS."


What am I doing wrong?

Alvaro Miranda Aguilera

unread,
Oct 3, 2016, 11:57:57 AM10/3/16
to vagra...@googlegroups.com
Please share the vagrant file you are using and the command you are typing to reproduce the issue.

Thanks
Alvaro.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1850224b-a080-42a9-985f-f5855ab7b079%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages