diff --git a/pipenv/utils.py b/pipenv/utils.py index 90a774e9..80ffc85d 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -439,7 +439,7 @@ def prepare_pip_source_args(sources, pip_args=None): # Trust the host if it's not verified. if not sources[0].get('verify_ssl', True): - pip_args.extend(['--trusted-host', urlparse(sources[0]['url']).netloc.split(':')[0]]) + pip_args.extend(['--trusted-host', urlparse(sources[0]['url']).hostname]) # Add additional sources as extra indexes. if len(sources) > 1: @@ -448,7 +448,7 @@ def prepare_pip_source_args(sources, pip_args=None): # Trust the host if it's not verified. if not source.get('verify_ssl', True): - pip_args.extend(['--trusted-host', urlparse(source['url']).netloc.split(':')[0]]) + pip_args.extend(['--trusted-host', urlparse(source['url']).hostname]) return pip_args