8000 Fix #31: add FTPS / FTP Over TLS support by zachcheung · Pull Request #121 · gobackup/gobackup · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix #31: add FTPS / FTP Over TLS support #121

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

Merged
merged 1 commit into from
Dec 23, 2022
Merged

Conversation

zachcheung
Copy link
Contributor

Added TLS related configs:

tls: bool  # set to `true` when is implicit TLS type FTP, default is `false`
explicit_tls: bool  # set to `true` when is explicit TLS type FTP, default is `false`
no_check_certificate: bool  # set to `true` when don't check the certificate, default is `false`

Explicit TLS FTP Server

Without TLS settings

storages:
  ftp:
    type: ftp
    path: /ftp
    host: ftp.example.com
    username: ftp
    password: password
2022/12/22 04:17:16 [Model: demo] Sorry, cleartext sessions and weak ciphers are not accepted on this server.
Please reconnect using TLS security mechanisms.

With wrong TLS type

storages:
  ftp:
    type: ftp
    path: /ftp
    host: ftp.example.com
    tls: true
    username: ftp
    password: password
2022/12/22 04:17:58 [Model: demo] tls: first record does not look like a TLS handshake

With correct TLS type

storages:
  ftp:
    type: ftp
    path: /ftp
    host: ftp.example.com
    explicit_tls: true
    username: ftp
    password: password
2022/12/22 04:18:23 [Storage] => Storage | ftp
2022/12/22 04:18:25 [FTP] -> Uploading...
2022/12/22 04:18:25 [FTP] Store /ftp/2022.12.22.04.18.23.tar.xz succeeded
2022/12/22 04:18:25 [FTP] Store succeeded
2022/12/22 04:18:25 [FTP] -> remove /ftp/2022.12.22.03.55.59.tar.xz
2022/12/22 04:18:25 [Cycler] Removed 2022.12.22.03.55.59.tar.xz

Host is not in the certificate

storages:
  ftp:
    type: ftp
    path: /ftp
    host: 127.0.0.1
    explicit_tls: true
    username: ftp
    password: password
2022/12/22 04:19:11 [Storage] => Storage | ftp
2022/12/22 04:19:11 [Model] Cleanup temp: /tmp/gobackup581589707/
2022/12/22 04:19:11 [Model: demo] x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs

Skip check the certificate (not recommended)

storages:
  ftp:
    type: ftp
    path: /ftp
    host: 127.0.0.1
    explicit_tls: true
    no_check_certificate: true
    username: ftp
    password: password
2022/12/22 04:19:39 [Storage] => Storage | ftp
2022/12/22 04:19:41 [FTP] -> Uploading...
2022/12/22 04:19:41 [FTP] Store /ftp/2022.12.22.04.19.39.tar.xz succeeded
2022/12/22 04:19:41 [FTP] Store succeeded
2022/12/22 04:19:41 [FTP] -> remove /ftp/2022.12.22.04.18.23.tar.xz
2022/12/22 04:19:41 [Cycler] Removed 2022.12.22.04.18.23.tar.xz

@huacnlee huacnlee merged commit 724e2b7 into gobackup:main Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0