Skip to content

Error: WS Error <Io(Custom { kind: Other, error: "unexpected EOF" })> #321

@OoLunar

Description

@OoLunar

I have the following piece of code for making a secure websocket:
main.rs:

let cert = X509::from_pem(std::fs::read_to_string("/etc/letsencrypt/archive/forsaken-borders.net/fullchain3.pem").unwrap().as_ref()).unwrap();
let pkey = PKey::private_key_from_pem(std::fs::read_to_string("/etc/letsencrypt/archive/forsaken-borders.net/privkey3.pem").unwrap().as_ref()).unwrap();
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
builder.set_private_key(&pkey).unwrap();
builder.set_certificate(&cert).unwrap();
let acceptor = builder.build();
ws::Builder::new().with_settings(ws::Settings { encrypt_server: true, ..ws::Settings::default() }).build(move |out: ws::Sender| structs::Irc { out, ssl: acceptor.clone() }).unwrap().listen("127.0.0.1:7325").unwrap()

structs.rs:

pub struct Irc {
    pub out: ws::Sender,
    pub ssl: openssl::ssl::SslAcceptor,
}

However, when parsing the SSL's, I get the error Error: WS Error <Io(Custom { kind: Other, error: "unexpected EOF" })> I know these SSL's work, because I'm using them right now on my website. Is there something else wrong that I'm doing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions