Skip to content

SSL error while using async_tls #36

Open
@localacct

Description

@localacct

Hi

When I tried to use async_tls to establish a TLS connection to a ncat instance (using self signed certificates that I generated), I saw this error from the ncat terminal and the connection just close.

Ncat: Failed SSL connection from 127.0.0.1: error:00000000:lib(0):func(0):reason(0)

I noticed on Wireshark that the program attempts the normal TCP handshake and then followed by FIN-ACK to close the connection. I did not see the TLS protocol being initiated. I followed the code snippet from async_tls' documentation.

async_std::task::block_on(async {
    let connector = TlsConnector::default();
    let tcp_stream = async_std::net::TcpStream::connect("127.0.0.1:4444").await?;
    let encrypted_stream = connector.connect("127.0.0.1:4444", tcp_stream).await?;

    Ok(()) as async_std::io::Result<()>
});

Could this be related to the certificate not being accepted? I tried looking at async_tls' and rustls' documentation but I did not find options for me to accept self signed certificates or other dangerous options that native_tls has.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions