-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels