ws-rs icon indicating copy to clipboard operation
ws-rs copied to clipboard

SSL Server example is outdated

Open creikey opened this issue 5 years ago • 2 comments

Uses the method SslAcceptorBuilder::mozilla_intermediate which has been deprecated in the ssl package since 0.9.14

creikey avatar Dec 25 '19 23:12 creikey

I don't know enough about rust to confidently open a PR for this, but I think the code:

let acceptor = Rc::new(SslAcceptorBuilder::mozilla_intermediate(
        SslMethod::tls(),
        &pkey,
        &cert,
        std::iter::empty::<X509Ref>(),
    ).unwrap().build());

Can be replaced with this new code that works with the most recent opensll api:

let mut acceptor_builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
    acceptor_builder.set_private_key(&pkey).unwrap();
    acceptor_builder.set_certificate(&cert).unwrap();
    let acceptor = Rc::new(acceptor_builder.build());

creikey avatar Dec 25 '19 23:12 creikey

With openssl 0.10.24 and later, mozilla_intermediate_v5() should be used. The old mozilla_intermediate() does not have TLS 1.3.

Darkspirit avatar Dec 27 '19 11:12 Darkspirit