diff options
| author | mo khan <mo.khan@gmail.com> | 2020-07-21 14:50:23 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-07-22 11:14:41 -0600 |
| commit | f4ec1f1bf826654ab963d32a2d4a2588ecb91c04 (patch) | |
| tree | d0273449c4569e2faffd053c4ed1287ef081a221 /spec/integration/python | |
| parent | ca675527b53c2a8316c962ee1a17bc1ee1c0c156 (diff) | |
Combine default/custom certs in cacert
Diffstat (limited to 'spec/integration/python')
| -rw-r--r-- | spec/integration/python/pip_spec.rb | 10 | ||||
| -rw-r--r-- | spec/integration/python/pipenv_spec.rb | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index e808188..a52b992 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -127,11 +127,13 @@ RSpec.describe "pip" do end end - context "when connecting to a private package repository with self signed certificate", environment: 'offline' do - let(:index_url) { "https://#{private_pypi_host}/simple" } - let(:bundle) { fixture_file_content('python/pypi.crt') } + context "when connecting to a private package repository with self signed certificate" do + let(:index_url) { "https://pypi.test/simple" } before do + add_host('pypi.test', '127.0.0.1') + start_proxy_server + runner.add_file('setup.py') do <<~RAW from setuptools import setup, find_packages @@ -148,7 +150,7 @@ setup( it 'downloads the packages and trusts the certificate' do report = runner.scan(env: { - 'ADDITIONAL_CA_CERT_BUNDLE' => bundle, + 'ADDITIONAL_CA_CERT_BUNDLE' => x509_certificate('wildcard.test').read, 'PIP_INDEX_URL' => index_url }) diff --git a/spec/integration/python/pipenv_spec.rb b/spec/integration/python/pipenv_spec.rb index b95f1fa..5cc9128 100644 --- a/spec/integration/python/pipenv_spec.rb +++ b/spec/integration/python/pipenv_spec.rb @@ -202,18 +202,20 @@ RSpec.describe "pipenv" do end end - context "when connecting to a private package repository with self signed certificate", environment: 'offline' do - let(:index_url) { "https://#{private_pypi_host}/simple" } - let(:bundle) { fixture_file_content('python/pypi.crt') } + context "when connecting to a private package repository with self signed certificate" do + let(:index_url) { "https://pypi.test/simple" } before do + add_host('pypi.test', '127.0.0.1') + start_proxy_server + runner.add_file('Pipfile', fixture_file_content('python/airgap-Pipfile.erb', index_url: index_url)) runner.add_file('Pipfile.lock', fixture_file_content('python/airgap-Pipfile.lock.erb', index_url: index_url)) end it 'downloads the packages and trusts the certificate' do report = runner.scan(env: { - 'ADDITIONAL_CA_CERT_BUNDLE' => bundle, + 'ADDITIONAL_CA_CERT_BUNDLE' => x509_certificate('wildcard.test').read, 'PIP_INDEX_URL' => index_url }) |
