Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle ssl cert for VPC #456

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions starcluster/plugins/ipcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def _write_config(self, master, user, profile_dir):
master.ssh.execute("rm -rf '%s'" % profile_dir)
master.ssh.execute('ipython profile create')
f = master.ssh.remote_file('%s/ipcontroller_config.py' % profile_dir)
ssh_server = "@".join([user, master.public_dns_name])
public_dns_name = master.public_dns_name or master.private_ip_address
ssh_server = "@".join([user, public_dns_name])
f.write('\n'.join([
"c = get_config()",
"c.HubFactory.ip='%s'" % master.private_ip_address,
Expand Down Expand Up @@ -221,7 +222,8 @@ def _start_notebook(self, master, user, profile_dir):
ssl_cert = posixpath.join(profile_dir, '%s.pem' % user)
if not master.ssh.isfile(user_cert):
log.info("Creating SSL certificate for user %s" % user)
ssl_subj = "/C=US/ST=SC/L=STAR/O=Dis/CN=%s" % master.dns_name
dns_name = master.dns_name or '/'
ssl_subj = "/C=US/ST=SC/L=STAR/O=Dis/CN=%s" % dns_name
master.ssh.execute(
"openssl req -new -newkey rsa:4096 -days 365 "
'-nodes -x509 -subj %s -keyout %s -out %s' %
Expand Down Expand Up @@ -254,7 +256,7 @@ def _start_notebook(self, master, user, profile_dir):
master.ssh.execute_async("ipython notebook --no-browser")
self._authorize_port(master, notebook_port, 'notebook')
log.info("IPython notebook URL: https://%s:%s" %
(master.dns_name, notebook_port))
(master.dns_name or master.private_ip_address, notebook_port))
log.info("The notebook password is: %s" % self.notebook_passwd)
log.warn("Please check your local firewall settings if you're having "
"issues connecting to the IPython notebook",
Expand Down