Skip to content

Commit

Permalink
Add self-signed cert
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Jul 24, 2024
1 parent e706886 commit 0da59ab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ jobs:
- uses: actions/checkout@v2

- name: Setup up Python 3.11
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip

- name: Update pip
run: python -m pip install -U pip
Expand Down Expand Up @@ -40,9 +41,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Update pip
run: python -m pip install -U pip
Expand Down Expand Up @@ -89,9 +91,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Update pip
run: python -m pip install -U pip
Expand Down Expand Up @@ -130,9 +133,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Update pip
run: python -m pip install -U pip
Expand Down Expand Up @@ -183,9 +187,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Update pip
run: python -m pip install -U pip
Expand Down
3 changes: 3 additions & 0 deletions ci_helpers/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ create_ftp_ftps_servers(){
mkdir $home_dir
useradd -p $(echo $pass | openssl passwd -1 -stdin) -d $home_dir $user
chown $user:$user $home_dir
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem -subj "/C=PE/ST=Lima/L=Lima/O=Acme Inc. /OU=IT Department/CN=acme.com"
chmod 755 /etc/vsftpd.pem

server_setup='''
listen=YES
Expand All @@ -32,6 +34,7 @@ chroot_local_user=YES
allow_writeable_chroot=YES'''

additional_ssl_setup='''
rsa_cert_file=/etc/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=NO
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/test_ftp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from __future__ import unicode_literals
import pytest
from smart_open import open
import ssl
from functools import partial

# localhost has self-signed cert, see ci_helpers/helpers.sh:create_ftp_ftps_servers
ssl.create_default_context = partial(ssl.create_default_context, cafile="/etc/vsftpd.pem")


@pytest.fixture(params=[("ftp", 21), ("ftps", 90)])
Expand Down

0 comments on commit 0da59ab

Please sign in to comment.