Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Error on HTTPS client request. #794

Closed
novacrazy opened this issue May 17, 2016 · 9 comments
Closed

SSL Error on HTTPS client request. #794

novacrazy opened this issue May 17, 2016 · 9 comments
Assignees

Comments

@novacrazy
Copy link

novacrazy commented May 17, 2016

For even something as simple as:

extern crate hyper;

use hyper::Client;

fn main() {
    let client = Client::new();
    let mut res = client.get("https://www.google.com/").send().unwrap();

    let mut body = String::new();
    res.read_to_string(&mut body).unwrap();
    println!("Test: {}", body);
}

I get this panic:

thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: 
Ssl(
    OpenSslErrors(
        [
            UnknownError { 
                library:  "SSL routines", 
                function: "SSL3_GET_SERVER_CERTIFICATE", 
                reason:   "certificate verify failed" 
            }
        ]
    )
)', ../src/libcore\result.rs:785

So either I'm missing something crucial like how to add root certs to hyper or something, I'm not sure. I don't really have anything to go on.

I'm on Windows 10.0.10586, using Rust 1.10.0-nightly (8492b6aa4 2016-05-14), and the Win32OpenSSL/Win64OpenSSL v1.0.2h 64-bit OpenSSL implementation for rust-openssl.

I have a feeling this isn't really a "bug" with either hyper or rust-openssl, but rather I simply don't know how to properly initialize whatever it is I need to in order to use HTTPS.

@seanmonstar
Copy link
Member

What version of hyper is this with?

@looah-bmtmch
Copy link

I'm getting the same problem whenever trying to use https, I tried the same code as shown by novacrazy while using version 0.9.4, and I'm getting the same error.

@seanmonstar
Copy link
Member

@looah-bmtmch on Windows?

@looah-bmtmch
Copy link

@seanmonstar windows 10

seanmonstar added a commit that referenced this issue May 17, 2016
It doesn't work, so it's just causing errors.

Closes #794
@novacrazy
Copy link
Author

@seanmonstar This was with hyper version 0.9.4

Any thoughts on why it would fail like this?

seanmonstar added a commit that referenced this issue May 18, 2016
It doesn't work, so it's just causing errors.

Closes #794
@seanmonstar seanmonstar self-assigned this May 18, 2016
@sfackler
Copy link
Contributor

@novacrazy Hyper previously didn't validate a server's certificates at all. This is super bad. That was fixed, but openssl doesn't know how find a trusted certificate list on Windows by default, hence the errors, since there are no trusted roots.

@dwillie
Copy link

dwillie commented May 30, 2016

I'm experiencing this on Raspbian armhf cross compiled from Debian 64bit with Hyper 0.9.6

@MrSpock
Copy link

MrSpock commented Jun 7, 2017

I have exact the same error on MacOS for signed certificate:

Hyper(Ssl(OpenSslErrors([UnknownError { library: "SSL routines", function: "ssl3_get_server_certificate", reason: "certificate verify failed" }])))

@seanmonstar
Copy link
Member

@MrSpock SSL is no longer in this library. From that error, it looks like you're using openssl. You may wish to check there.

@hyperium hyperium locked and limited conversation to collaborators Jun 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants