Skip to content

Make SSL tests work - #15784

Merged
bors-servo merged 7 commits into
servo:masterfrom
jdm:ssltests
Apr 6, 2017
Merged

bors-servo merged 7 commits into
servo:masterfrom
jdm:ssltests

Conversation

@jdm

@jdm jdm commented Mar 1, 2017 •

Copy link
Copy Markdown
Member

These changes fix #6919.


This change is Reviewable

@highfive

highfive commented Mar 1, 2017

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @jgraham: tests/wpt/harness/wptrunner/executors/executorservo.py, tests/wpt/harness/wptrunner/browsers/servo.py
  • @fitzgen: components/script/dom/document.rs, components/script/dom/htmlimageelement.rs, components/script/document_loader.rs, components/script/script_thread.rs
  • @KiChjang: components/script/dom/document.rs, components/script/dom/htmlimageelement.rs, components/script/document_loader.rs, components/script/script_thread.rs, components/net/connector.rs

@highfive

highfive commented Mar 1, 2017

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 1, 2017
@jdm

jdm commented Mar 1, 2017

Copy link
Copy Markdown
Member Author

This addresses the issue tracked in #6919.

@jdm

jdm commented Mar 1, 2017

Copy link
Copy Markdown
Member Author

Whoops, I only meant to include the last commit in this branch. Anyways, ignore the others.

@jgraham

jgraham commented Mar 2, 2017

Copy link
Copy Markdown
Contributor

Firefox has a pref that mimics the behaviour of /etc/hosts so from the point of view of the networking code the domain and certificate match [1] and uses certutil to actually install the certificates into the local certificate database [2].

[1] https://dxr.mozilla.org/mozilla-central/source/testing/web-platform/harness/wptrunner/browsers/firefox.py#139
[2] https://dxr.mozilla.org/mozilla-central/source/testing/web-platform/harness/wptrunner/browsers/firefox.py#227

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #15771) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Mar 8, 2017
@jdm jdm assigned jdm and unassigned emilio Mar 15, 2017
@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 15, 2017
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 6, 2017
@jdm jdm removed the S-needs-rebase There are merge conflict errors. label Apr 6, 2017
@jdm jdm changed the title Make SSL tests work in some configurations Make SSL tests work Apr 6, 2017
@jdm jdm assigned nox and unassigned jdm Apr 6, 2017
@jdm

jdm commented Apr 6, 2017

Copy link
Copy Markdown
Member Author

@nox, the network changes should be familiar to you now. @jgraham could you sign off on the wptrunner changes?

@nox nox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commits "Update mozilla/ WPT results." and "Update results for remaining https tests in WPT." need to be squashed with "Only replace hosts when making TCP connections, not when verifying SSL certificates."

And you would please the old man I am if you would shorten that last commit title I had trouble pasting.

Comment thread components/net/connector.rs Outdated
None => resources_dir_path()
.expect("Need certificate file to make network requests")
.join(certificate_file),
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, so the argument is ignored if there is a certificate_path? Please either pass the certificate_path option to the function in callers, or remove the argument altogether; it feels weird that the option takes precedence over the argument.

Comment thread components/net/http_loader.rs Outdated

fn connect(&self, host: &str, port: u16, scheme: &str) -> Result<Self::Stream, HttpError> {
self.connector.connect(&replace_host(host), port, scheme)
self.connector.connect(host, port, scheme)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation exists only to do that replace_host call, now that it is gone you can pass &self.connector again to HyperRequest::with_connector in NetworkHttpRequestFactory::create and remove this impl altogether.

Hah, you killed the whole wrapper in next commit, nice!

// since things like image fetches are classified differently by devtools
let is_xhr = request.destination == Destination::None;
let wrapped_response = obtain_response(&factory, &url, &request.method,
let wrapped_response = obtain_response(context.connector.clone(), &url, &request.method,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this clone is pointless, and you can pass &Pool<Connector> to obtain_response.

@jdm jdm Apr 6, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was what I tried originally, and Rust's type checker became so confused that I didn't want to try to debug it. Please don't make me investigate it; it ends up trying to use the closure connector feature instead and it's not worth it.

@nox nox added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 6, 2017
@jgraham

jgraham commented Apr 6, 2017

Copy link
Copy Markdown
Contributor

Reviewed 1 of 3 files at r1.
Review status: 1 of 942 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


Comments from Reviewable

@jgraham

jgraham commented Apr 6, 2017

Copy link
Copy Markdown
Contributor

wptrunner changes look fine; please remember to upstream them.

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Apr 6, 2017
@jdm

jdm commented Apr 6, 2017

Copy link
Copy Markdown
Member Author

@bors-servo: r=nox,jgraham

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit ca2cc00 has been approved by nox,jgraham

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Apr 6, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit ca2cc00 with merge cd1dbf7...

bors-servo pushed a commit that referenced this pull request Apr 6, 2017
Make SSL tests work

These changes fix #6919.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15784)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt1

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 6, 2017
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 6, 2017
@jdm

jdm commented Apr 6, 2017

Copy link
Copy Markdown
Member Author

@bors-servo: r=nox,jgraham

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 6f590a8 has been approved by nox,jgraham

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 6, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6f590a8 with merge f3fd823...

bors-servo pushed a commit that referenced this pull request Apr 6, 2017
Make SSL tests work

These changes fix #6919.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15784)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: nox,jgraham
Pushing f3fd823 to master...

@bors-servo
bors-servo merged commit 6f590a8 into servo:master Apr 6, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTPS tests break in WPT with certification validation error

6 participants