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
Make SSL cert verification errors work again. Add a horrible, no-good… #6935
Merged
+63
−20
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -0,0 +1,28 @@ | ||
| <html> | ||
| <head> | ||
| <script src="/resources/testharness.js"></script> | ||
| <script src="/resources/testharnessreport.js"></script> | ||
| <script src="resources/origin_helpers.js?pipe=sub"></script> | ||
| </head> | ||
| <body> | ||
| <script> | ||
| var t = async_test("Invalid SSL cert noticed"); | ||
| t.step(function() { | ||
| var target = location.href.replace(HTTP_ORIGIN, HTTPS_ORIGIN) | ||
| .replace('bad_cert_detected.html', | ||
| 'resources/origin_helpers.js'); | ||
| // Servo currently lacks the ability to introspect any content that is blocked | ||
| // due to a cert error, so we use a roundabout method to infer that that's happened. | ||
| // When the worker has a cert failure, that translates into attempting to evaluate the | ||
| // contents of badcert.html as JS, which triggers an exception that currently does not | ||
| // propagate to the parent scope. If we _do_ get an error event in the parent scope, | ||
| // that means that the cert verification was treated no different than any other | ||
| // network error, since we dispatch an error event in that case. | ||
| var w = new Worker(target); | ||
| w.addEventListener('error', t.unreached_func("cert not detected as invalid"), false); | ||
| // We infer that we detected an invalid cert if nothing happens for a few seconds. | ||
| setTimeout(function() { t.done() }, 3000); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
| @@ -0,0 +1,5 @@ | ||
| var HTTP_PORT = '{{ports[http][0]}}'; | ||
| var HTTPS_PORT = '{{ports[https][0]}}'; | ||
| var ORIGINAL_HOST = '\'{{host}}\''; | ||
| var HTTP_ORIGIN = 'http://' + ORIGINAL_HOST + ':' + HTTP_PORT; | ||
| var HTTPS_ORIGIN = 'https://' + ORIGINAL_HOST + ':' + HTTPS_PORT; |
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Nit: you can use
letinstead ofmatchhere since there is only one variant.(This is still hacky, but I feel much better about this than what we could do before
Error::downcast_refwas added.)