Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssl 镍服务器使用Let';s加密证书在使用rustls访问时发生握手错误_Ssl_Rust_Hyper_Nickel - Fatal编程技术网

Ssl 镍服务器使用Let';s加密证书在使用rustls访问时发生握手错误

Ssl 镍服务器使用Let';s加密证书在使用rustls访问时发生握手错误,ssl,rust,hyper,nickel,Ssl,Rust,Hyper,Nickel,我正在尝试创建一个类似REST的小API,它应该使用HTTPS进行保护。我想用镍箱装服务器,用hyper_rustls和hyper装客户端 只要我使用浏览器、curl或REST客户端访问服务器,服务器运行良好,但当我开始使用hyper_rustls时,总是会出现握手错误: TLS错误:收到警报(握手警报) 连接关闭 为了定位错误,我设置了一个最小服务器: #[macro_use] extern crate nickel; extern crate hyper; use hyper::net::

我正在尝试创建一个类似REST的小API,它应该使用HTTPS进行保护。我想用镍箱装服务器,用hyper_rustls和hyper装客户端

只要我使用浏览器、curl或REST客户端访问服务器,服务器运行良好,但当我开始使用hyper_rustls时,总是会出现握手错误:

TLS错误:收到警报(握手警报)
连接关闭
为了定位错误,我设置了一个最小服务器:

#[macro_use]
extern crate nickel;
extern crate hyper;
use hyper::net::Openssl;


use nickel::Nickel;

fn main() {
    let mut server = Nickel::new();

    server.utilize(router! {
        get "**" => |_req, _res| {
            "Hello world!"
        }
    });

    // FIXME: Add Match Error and OK instead of unwreap and add a propper error handling
    let ssl = Openssl::with_cert_and_key("/etc/letsencrypt/live/www.example.de/fullchain.\
                                          pem",
                                         "/etc/letsencrypt/live/www.example.de/privkey.pem")
        .unwrap();

    server.listen_https("0.0.0.0:6767", ssl).expect("Failed to launch server");
}

  • Chrome中的有效证书:

为了避免hyper_rustls中出现错误,我使用了,但错误仍然出现

Let's Encrypt证书不是问题,因为我可以使用tlsclient使用这些证书连接到Apache2服务器


我在思考这是如何工作的时候犯了错误吗?

它看起来像是hyper的
Openssl::with\u cert\u和\u key
告诉Openssl使用
默认密码套件列表,这非常糟糕。在这种情况下,rustls无法握手,原因与chrome上说的“过时的密钥交换(RSA)”相同。如果您运行服务器并指向ssllabs.com,您将获得更多信息


我认为最近的hyper版本删除了这段代码,转而支持从其他板条箱获得TLS支持。你能试试吗?

谢谢你的回答!你说得对,我用hyper_openssl和hyper 0.10试过了,现在rustls连接正常了,Chrome不再显示“过时的密钥交换(RSA)”!我应该把它作为臭虫报告给nickel吗?我不确定是否有一天会有一个版本与超0.10。。。