Comments (10)
I don't think it's supported at the moment, but I can work on it
from suppaftp.
Really appreciate your efforts. Is asking for ETA ok? Thanks
from suppaftp.
I can try to release it in two days
from suppaftp.
The feature is now available in suppaftp 4.3.0, please see the example below:
use suppaftp::FtpStream;
use suppaftp::native_tls::{TlsConnector, TlsStream};
use std::path::Path;
// Create a TlsConnector
// NOTE: For custom options see <https://docs.rs/native-tls/0.2.6/native_tls/struct.TlsConnectorBuilder.html>
let mut ctx = TlsConnector::new().unwrap();
let mut ftp_stream = FtpStream::connect_secure_implicit("127.0.0.1:990", ctx, "localhost").unwrap();
In order to enable the connect_secure_implicit
method, you have to compile suppaftp with the deprecated
feature.
from suppaftp.
Hello, Developer and Landlord,when i called into_secure, it hanged at " SecureError("error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed: " , How to add certificates for clients? thank you!
from suppaftp.
You should try some options of the tls builder:
let ctx = TlsConnector::builder()
.danger_accept_invalid_certs(true)
.danger_accept_invalid_hostnames(true)
.build()
from suppaftp.
thanks!
from suppaftp.
Is this still supported in the latest version? With the "deprecated", "native-tls"
features enabled, and the sample code
use suppaftp::FtpStream;
use suppaftp::native_tls::{TlsConnector, TlsStream};
let mut ctx = TlsConnector::new().unwrap();
let mut ftp_stream = FtpStream::connect_secure_implicit("127.0.0.1:990", ctx, "localhost").unwrap();
I get the error
error[E0277]: the trait bound `native_tls::TlsConnector: suppaftp::sync_ftp::tls::TlsConnector` is not satisfied
--> src/interfaces/ftp.rs:63:82
|
63 | let mut ftp_stream = FtpStream::connect_secure_implicit("127.0.0.1:990", ctx, "localhost").unwrap();
| ---------------------------------- ^^^ the trait `suppaftp::sync_ftp::tls::TlsConnector` is not implemented for `native_tls::TlsConnector`
| |
| required by a bound introduced by this call
|
= help: the trait `suppaftp::sync_ftp::tls::TlsConnector` is implemented for `NativeTlsConnector`
note: required by a bound in `ImplFtpStream::<T>::connect_secure_implicit`
--> /Users/svet/.cargo/registry/src/github.com-1ecc6299db9ec823/suppaftp-5.1.1/src/sync_ftp/mod.rs:184:29
|
184 | tls_connector: impl TlsConnector<Stream = T> + 'static,
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ImplFtpStream::<T>::connect_secure_implicit`
If I follow the "help" hint and instead set ctx
to
let mut ctx = NativeTlsConnector::from(TlsConnector::new().unwrap());
I get a type mismatch on it:
error[E0271]: type mismatch resolving `<NativeTlsConnector as suppaftp::sync_ftp::tls::TlsConnector>::Stream == suppaftp::sync_ftp::tls::NoTlsStream`
--> src/interfaces/ftp.rs:64:82
|
64 | let mut ftp_stream = FtpStream::connect_secure_implicit("127.0.0.1:990", ctx, "localhost").unwrap();
| ---------------------------------- ^^^ expected struct `suppaftp::sync_ftp::tls::NoTlsStream`, found struct `suppaftp::sync_ftp::tls::native_tls::NativeTlsStream`
| |
| required by a bound introduced by this call
Any hints as to how to go about this?
from suppaftp.
@svet-b you're using the wrong type. You need to use NativeTlsFtpStream
and not FtpStream
from suppaftp.
Thanks for the quick response @veeso - really appreciate your help here!
The following indeed seems to work 👍
use suppaftp::{NativeTlsConnector, NativeTlsFtpStream};
use suppaftp::native_tls::TlsConnector;
let mut ctx = NativeTlsConnector::from(TlsConnector::new().unwrap());
let mut ftp_stream = NativeTlsFtpStream::connect_secure_implicit("127.0.0.1:990", ctx, "localhost").unwrap();
from suppaftp.
Related Issues (20)
- [BUG] - features are not additive HOT 3
- [Feature Request] - Expose DataStream to users HOT 1
- Damaged uploaded image HOT 3
- [Feature Request] - Set a timeout on FTP connect
- [Feature Request] Allow interchangeable use of stream types by exposing ImplFtpStream HOT 5
- [QUESTION] - Reading files when using AsyncFtpStream HOT 2
- [QUESTION] - How to properly use resume_transfer HOT 5
- Problem setting up TLS -> bad server or bad client? HOT 2
- [Feature Request] - Add Send trait to AsyncFtpStream/FtpStream
- [SECURITY] - upgrade chrono->time dependency HOT 1
- [QUESTION] - Is it support download large file? HOT 2
- [BUG] - Async TLS example fails to compile HOT 1
- [BUG] - list method request failed BadResponse HOT 6
- [Feature Request] - OPTS and FEAT commands support
- [BUG] - expected `AsyncNoTlsStream`, found `AsyncNativeTlsStream` HOT 1
- [BUG] - Ftp with TLS (native-tls) Not working HOT 4
- [QUESTION] - 522 SSL connection failed
- [Feature Request] - Build the docs with doc_cfg
- [BUG] - POSIX setgid/setuid/sticky bits not supported
- [Feature Request] - Better composability HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suppaftp.