You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenSSL does not automatically verify that the hostname in the URL matches the subject name or SAN (subject alternate name) in the certificate. The application must do this. It might make sense to put some of this functionality into Hyper.
I'm pretty sure you just need to set the right flags in rust-openssl and it will do the verification for you.
this is what we do (using these certificates obtained from Firefox via this script), but we need to set some more openssl flags manually there (I forgot which ones, but the functions here should give you some idea)
@Manishearth does rust-openssl implement RFC6125 itself? Prior to openssl "1.1.0" (i.e. unreleased), OpenSSL provided no native support for hostname verification.
-----Original Message-----
From: "Tony Arcieri" [email protected]
Sent: 4/27/2015 12:12 AM
To: "servo/servo" [email protected]
Cc: "Manish Goregaokar" [email protected]
Subject: Re: [servo] Verify hostnames in SSL certificates (#4954)
@Manishearth does rust-openssl implement RFC6125 itself? Prior to openssl "1.1.0" (i.e. unreleased), OpenSSL provided no native support for hostname verification.
—
Reply to this email directly or view it on GitHub.
Basically what I'm saying is no released version of OpenSSL has native support for hostname verification, so if something is doing it, it's some code someone wrote in Rust themselves.
An alternative is to bind to nss or pkix from the Mozilla tree, IIRC both are independent libraries. I recommend using pkix.
-----Original Message-----
From: "Tony Arcieri" [email protected]
Sent: 4/27/2015 12:26 AM
To: "servo/servo" [email protected]
Cc: "Manish Goregaokar" [email protected]
Subject: Re: [servo] Verify hostnames in SSL certificates (#4954)
Basically what I'm saying is no released version of OpenSSL has native support for hostname verification, so if something is doing it, it's some code someone wrote in Rust themselves.
—
Reply to this email directly or view it on GitHub.
Alternatively, could you structure this so that it uses openssl for the cert checking, and then has its own verification method that operates on the cert and URL? Something that can be fed to the verification method of sslcontext.
-----Original Message-----
From: "Tony Arcieri" [email protected]
Sent: 4/27/2015 12:26 AM
To: "servo/servo" [email protected]
Cc: "Manish Goregaokar" [email protected]
Subject: Re: [servo] Verify hostnames in SSL certificates (#4954)
Basically what I'm saying is no released version of OpenSSL has native support for hostname verification, so if something is doing it, it's some code someone wrote in Rust themselves.
—
Reply to this email directly or view it on GitHub.
My assumption is that it manifests as a network error inside Servo, and each network response consumer can choose how to handle those independently. For document loads, we display about:sslfail at the moment.
I believe only the default client has hostname validation enabled by the changes in #784. We'll need to adapt them for our own code (see create_http_connector in http_loader.rs).
When I add a set_verify_callback, Servo just displays a blank page when I try to load a page with an invalid certificate. (This is the same thing it does for me on other network errors, like a hostname that doesn't resolve.)
Activity
Manishearth commentedon Feb 18, 2015
I guess we'll need to
set_verifyand all?mbrubeck commentedon Feb 18, 2015
We can use
X509_VERIFY_PARAM_set1_hostandset_verifyif we require OpenSSL 1.0.2 or later.If we need to support older versions (currently we use 1.0.1 on Android, for example), we need to include code like this sample code.
frewsxcv commentedon Apr 26, 2015
Worth noting this is also an issue in Hyper: hyperium/hyper#472
Manishearth commentedon Apr 26, 2015
Not exactly,
hyperprovides the right hooks, we just don't use them to their full extents.tarcieri commentedon Apr 26, 2015
I just started an RFC6125 hostname verification library for Rust:
https://github.com/tarcieri/pkixnames
I plan on modeling its behavior off of both Chrome and Firefox
Manishearth commentedon Apr 26, 2015
cool!
I'm pretty sure you just need to set the right flags in rust-openssl and it will do the verification for you.
this is what we do (using these certificates obtained from Firefox via this script), but we need to set some more openssl flags manually there (I forgot which ones, but the functions here should give you some idea)
tarcieri commentedon Apr 26, 2015
@Manishearth does rust-openssl implement RFC6125 itself? Prior to openssl "1.1.0" (i.e. unreleased), OpenSSL provided no native support for hostname verification.
Manishearth commentedon Apr 26, 2015
No idea, you probably should check openssl-sys
-----Original Message-----
From: "Tony Arcieri" [email protected]
Sent: 4/27/2015 12:12 AM
To: "servo/servo" [email protected]
Cc: "Manish Goregaokar" [email protected]
Subject: Re: [servo] Verify hostnames in SSL certificates (#4954)
@Manishearth does rust-openssl implement RFC6125 itself? Prior to openssl "1.1.0" (i.e. unreleased), OpenSSL provided no native support for hostname verification.
—
Reply to this email directly or view it on GitHub.
tarcieri commentedon Apr 26, 2015
Basically what I'm saying is no released version of OpenSSL has native support for hostname verification, so if something is doing it, it's some code someone wrote in Rust themselves.
Manishearth commentedon Apr 26, 2015
Ah, I see.
An alternative is to bind to nss or pkix from the Mozilla tree, IIRC both are independent libraries. I recommend using pkix.
-----Original Message-----
From: "Tony Arcieri" [email protected]
Sent: 4/27/2015 12:26 AM
To: "servo/servo" [email protected]
Cc: "Manish Goregaokar" [email protected]
Subject: Re: [servo] Verify hostnames in SSL certificates (#4954)
Basically what I'm saying is no released version of OpenSSL has native support for hostname verification, so if something is doing it, it's some code someone wrote in Rust themselves.
—
Reply to this email directly or view it on GitHub.
tarcieri commentedon Apr 26, 2015
@Manishearth I'm basically planning on reimplementing the hostname verification part of pkix in pure Rust, FWIW
Manishearth commentedon Apr 26, 2015
Alternatively, could you structure this so that it uses openssl for the cert checking, and then has its own verification method that operates on the cert and URL? Something that can be fed to the verification method of sslcontext.
-----Original Message-----
From: "Tony Arcieri" [email protected]
Sent: 4/27/2015 12:26 AM
To: "servo/servo" [email protected]
Cc: "Manish Goregaokar" [email protected]
Subject: Re: [servo] Verify hostnames in SSL certificates (#4954)
Basically what I'm saying is no released version of OpenSSL has native support for hostname verification, so if something is doing it, it's some code someone wrote in Rust themselves.
—
Reply to this email directly or view it on GitHub.
tarcieri commentedon Apr 26, 2015
Yep, that's exactly what my library vaporware library would allow you to do 😉
11 remaining items
jdm commentedon May 10, 2016
My assumption is that it manifests as a network error inside Servo, and each network response consumer can choose how to handle those independently. For document loads, we display about:sslfail at the moment.
mbrubeck commentedon May 10, 2016
Note: We haven't updated to hyper 0.9.4, so Hyper's hostname verification is not in Servo master yet.
I just built with hyper 0.9.4 locally, and https://blog.rust-lang.org/ loaded with no errors in Servo. (It should trigger a certificate verification error.) I'm not sure yet whether this is a bug in Servo or in Hyper...
jdm commentedon May 10, 2016
I believe only the default client has hostname validation enabled by the changes in #784. We'll need to adapt them for our own code (see
create_http_connectorinhttp_loader.rs).jdm commentedon May 10, 2016
Although I guess we could verify it by seeing if
wrap_clientgets called in hyper.mbrubeck commentedon May 10, 2016
Indeed, we are using
hyper::net::Opensslinstead ofhyper::net::OpensslClient, andOpenssl::wrap_clientdoes not doset_verify_callback.mbrubeck commentedon May 10, 2016
When I add a
set_verify_callback, Servo just displays a blank page when I try to load a page with an invalid certificate. (This is the same thing it does for me on other network errors, like a hostname that doesn't resolve.)Use openssl-verify to check certificate + hostname
Use openssl-verify to check certificate + hostname
Auto merge of #11115 - mbrubeck:openssl-verify, r=jdm
Use openssl-verify to check certificate + hostname
Use openssl-verify to check certificate + hostname