Skip to content

TLS 1.3. Issue while creating FTPS server #542

@shanithkk

Description

@shanithkk

Error:

lftp alice@0.0.0.0:~> ls                    
ls: Fatal error: SSL_connect: wrong version number

Creating the ftps server


pub async fn start_ftps_server(config: FtpConfig, logger: Arc<Logger>) -> Result<()> {
    if config.host_keys.len() < 2 {
        eprintln!("FTPS requires both certificate and private key files");
        return Err(anyhow::anyhow!("Missing TLS configuration"));
    }

    let cert_file = &config.host_keys[0];
    let key_file = &config.host_keys[1];

    let authenticator = Arc::new(MultiAuthenticator::new(config.users.clone(), logger));

    let root_dir = config.root_dir;

    let server = Server::with_fs(root_dir)
        .authenticator(authenticator)
        .ftps(cert_file, key_file)
        .active_passive_mode(libunftp::options::ActivePassiveMode::ActiveAndPassive)
        // .ftps_client_auth(FtpsClientAuth::)
        .ftps_required(FtpsRequired::All, FtpsRequired::All)
        .ftps_tls_flags(
            TlsFlags::V1_2
                | TlsFlags::RESUMPTION_SESS_ID
                | TlsFlags::RESUMPTION_TICKETS
                | TlsFlags::V1_3,
        )
        .greeting("Welcome to Multi-Protocol FTPS Server")
        .build()?;

    let addr = format!("{}:{}", config.listen_address, config.port);
    server.listen(&addr).await?;
    Ok(())
}

i can connect the serve over ftp protocol using the command below

lftp -e "set ftp:ssl-force true; set ssl:verify-certificate no; connect ftp://alice:alice@localhost:990" 

Expected:

i want to create ftps server with protocol ftps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions