Skip to content

Commit f6c1c7e

Browse files
author
Rogerio Varalda Jr
committed
feat(deis client): add ssl-verify parameter to deis register command
I've just copied and pasted from deis login command.
1 parent 8826c83 commit f6c1c7e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

client/deis.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,11 @@ def auth_register(self, args):
707707
provide a password for the new account.
708708
--email=<email>
709709
provide an email address.
710+
--ssl-verify=false
711+
disables SSL certificate verification for API requests
710712
"""
711713
controller = args['<controller>']
714+
ssl_verify = True
712715
if not urlparse.urlparse(controller).scheme:
713716
controller = "http://{}".format(controller)
714717
username = args.get('--username')
@@ -721,12 +724,16 @@ def auth_register(self, args):
721724
if password != confirm:
722725
self._logger.error('Password mismatch, aborting registration.')
723726
sys.exit(1)
727+
ssl_option = args.get('--ssl-verify')
728+
if ssl_option == 'false':
729+
ssl_verify = False
724730
email = args.get('--email')
725731
if not email:
726732
email = raw_input('email: ')
727733
url = urlparse.urljoin(controller, '/v1/auth/register')
728734
payload = {'username': username, 'password': password, 'email': email}
729-
response = self._session.post(url, data=payload, allow_redirects=False)
735+
response = self._session.post(url, data=payload, allow_redirects=False,
736+
verify=ssl_verify)
730737
if response.status_code == requests.codes.created:
731738
self._settings['controller'] = controller
732739
self._settings.save()

0 commit comments

Comments
 (0)