From 19a2516e105f6ac6c4e3d6027c150bd7c06ad89d Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 31 Mar 2017 15:49:24 +0200 Subject: [PATCH 1/4] Disable wss support None of the existing websocket libraries are currently able to cope with openssl 0.9 and be featureful, so we are disabling wss for now to land openssl 0.9. --- components/net/resource_thread.rs | 3 +- components/net/websocket_loader.rs | 62 +++++++------------ .../Create-Secure-extensions-empty.htm.ini | 6 +- ...e-Secure-valid-url-array-protocols.htm.ini | 9 +++ ...e-Secure-valid-url-binaryType-blob.htm.ini | 9 +++ ...re-valid-url-protocol-setCorrectly.htm.ini | 9 +++ ...e-Secure-valid-url-protocol-string.htm.ini | 9 +++ .../Create-Secure-valid-url.htm.ini | 9 +++ .../Secure-Close-1000-reason.htm.ini | 9 +++ .../Secure-Close-1000-verify-code.htm.ini | 9 +++ .../websockets/Secure-Close-1000.htm.ini | 9 +++ .../Secure-Close-1005-verify-code.htm.ini | 9 +++ .../websockets/Secure-Close-1005.htm.ini | 6 ++ .../Secure-Close-2999-reason.htm.ini | 6 ++ .../Secure-Close-3000-reason.htm.ini | 9 +++ .../Secure-Close-3000-verify-code.htm.ini | 9 +++ .../Secure-Close-4999-reason.htm.ini | 9 +++ .../Secure-Close-Reason-124Bytes.htm.ini | 6 ++ ...e-Close-Reason-Unpaired-surrogates.htm.ini | 9 +++ .../Secure-Close-onlyReason.htm.ini | 6 ++ .../Secure-Close-readyState-Closed.htm.ini | 9 +++ .../Secure-Close-readyState-Closing.htm.ini | 6 ++ ...ecure-Close-server-initiated-close.htm.ini | 9 +++ .../websockets/Secure-Close-undefined.htm.ini | 6 ++ .../websockets/Secure-Send-65K-data.htm.ini | 12 ++++ ...Secure-Send-binary-65K-arraybuffer.htm.ini | 12 ++-- .../Secure-Send-binary-arraybuffer.htm.ini | 12 ++-- ...end-binary-arraybufferview-float64.htm.ini | 9 ++- ...-Send-binary-arraybufferview-int32.htm.ini | 9 ++- ...raybufferview-uint16-offset-length.htm.ini | 9 ++- ...nary-arraybufferview-uint32-offset.htm.ini | 9 ++- ...rraybufferview-uint8-offset-length.htm.ini | 9 ++- ...inary-arraybufferview-uint8-offset.htm.ini | 9 ++- .../Secure-Send-binary-blob.htm.ini | 12 ++++ .../websockets/Secure-Send-data.htm.ini | 12 ++++ .../websockets/Secure-Send-null.htm.ini | 12 ++++ .../Secure-Send-paired-surrogates.htm.ini | 12 ++++ .../Secure-Send-unicode-data.htm.ini | 12 ++++ .../Secure-Send-unpaired-surrogates.htm.ini | 12 ++++ .../websockets/binaryType-wrong-value.htm.ini | 9 +++ 40 files changed, 340 insertions(+), 73 deletions(-) create mode 100644 tests/wpt/metadata/websockets/Create-Secure-valid-url-array-protocols.htm.ini create mode 100644 tests/wpt/metadata/websockets/Create-Secure-valid-url-binaryType-blob.htm.ini create mode 100644 tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-setCorrectly.htm.ini create mode 100644 tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-string.htm.ini create mode 100644 tests/wpt/metadata/websockets/Create-Secure-valid-url.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-1000-reason.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-1000-verify-code.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-1000.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-1005-verify-code.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-1005.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-2999-reason.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-3000-reason.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-3000-verify-code.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-4999-reason.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-Reason-124Bytes.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-Reason-Unpaired-surrogates.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-onlyReason.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-readyState-Closed.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-readyState-Closing.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-server-initiated-close.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Close-undefined.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-65K-data.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-binary-blob.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-data.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-null.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-paired-surrogates.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-unicode-data.htm.ini create mode 100644 tests/wpt/metadata/websockets/Secure-Send-unpaired-surrogates.htm.ini create mode 100644 tests/wpt/metadata/websockets/binaryType-wrong-value.htm.ini diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index d216ccbd907..b734058ad65 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -357,7 +357,6 @@ impl CoreResourceManager { resource_grp: &ResourceGroup) { websocket_loader::init(connect, connect_data, - resource_grp.cookie_jar.clone(), - resource_grp.ssl_context.clone()); + resource_grp.cookie_jar.clone()); } } diff --git a/components/net/websocket_loader.rs b/components/net/websocket_loader.rs index 87cd83d5437..ae40026614c 100644 --- a/components/net/websocket_loader.rs +++ b/components/net/websocket_loader.rs @@ -11,14 +11,13 @@ use hyper::header::{Accept, CacheControl, CacheDirective, Connection, Connection use hyper::header::{Headers, Host, SetCookie, Pragma, Protocol, ProtocolName, Upgrade}; use hyper::http::h1::{LINE_ENDING, parse_response}; use hyper::method::Method; -use hyper::net::{HttpStream, HttpsStream}; +use hyper::net::HttpStream; use hyper::status::StatusCode; use hyper::version::HttpVersion; use net_traits::{CookieSource, MessageData, NetworkError, WebSocketCommunicate, WebSocketConnectData}; use net_traits::{WebSocketDomAction, WebSocketNetworkEvent}; use net_traits::hosts::replace_host; use net_traits::request::Type; -use openssl::ssl::{SslContext, SslStream}; use servo_url::ServoUrl; use std::ascii::AsciiExt; use std::io::{self, Write}; @@ -35,14 +34,12 @@ use websocket::sender::Sender; pub fn init(connect: WebSocketCommunicate, connect_data: WebSocketConnectData, - cookie_jar: Arc>, - ssl_context: Arc) { + cookie_jar: Arc>) { thread::Builder::new().name(format!("WebSocket connection to {}", connect_data.resource_url)).spawn(move || { let channel = establish_a_websocket_connection(&connect_data.resource_url, connect_data.origin, connect_data.protocols, - cookie_jar, - ssl_context); + cookie_jar); let (ws_sender, mut receiver) = match channel { Ok((protocol_in_use, sender, receiver)) => { let _ = connect.event_sender.send(WebSocketNetworkEvent::ConnectionEstablished { protocol_in_use }); @@ -117,11 +114,10 @@ pub fn init(connect: WebSocketCommunicate, }).expect("Thread spawning failed"); } -type Stream = HttpsStream>; +type Stream = HttpStream; // https://fetch.spec.whatwg.org/#concept-websocket-connection-obtain -fn obtain_a_websocket_connection(url: &ServoUrl, ssl_context: Arc) - -> Result { +fn obtain_a_websocket_connection(url: &ServoUrl) -> Result { // Step 1. let host = url.host_str().unwrap(); @@ -137,27 +133,23 @@ fn obtain_a_websocket_connection(url: &ServoUrl, ssl_context: Arc) _ => panic!("URL's scheme should be ws or wss"), }; + if secure { + return Err(NetworkError::Internal("WSS is disabled for now.".into())); + } + // Steps 4-5. let host = replace_host(host); let tcp_stream = TcpStream::connect((&*host, port)).map_err(|e| { NetworkError::Internal(format!("Could not connect to host: {}", e)) })?; - let http_stream = HttpStream(tcp_stream); - if !secure { - return Ok(HttpsStream::Http(http_stream)); - } - let ssl_stream = SslStream::connect(&*ssl_context, http_stream).map_err(|e| { - NetworkError::from_ssl_error(url, &e) - })?; - Ok(HttpsStream::Https(ssl_stream)) + Ok(HttpStream(tcp_stream)) } // https://fetch.spec.whatwg.org/#concept-websocket-establish fn establish_a_websocket_connection(resource_url: &ServoUrl, origin: String, protocols: Vec, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result<(Option, Sender, Receiver), @@ -192,7 +184,7 @@ fn establish_a_websocket_connection(resource_url: &ServoUrl, // TODO: handle permessage-deflate extension. // Step 11 and network error check from step 12. - let response = fetch(resource_url, origin, headers, cookie_jar, ssl_context)?; + let response = fetch(resource_url, origin, headers, cookie_jar)?; // Step 12, the status code check. if response.status != StatusCode::SwitchingProtocols { @@ -279,8 +271,7 @@ struct Response { fn fetch(url: &ServoUrl, origin: String, mut headers: Headers, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result { // Step 1. // TODO: handle request's window. @@ -324,15 +315,14 @@ fn fetch(url: &ServoUrl, } // Step 8. - main_fetch(url, origin, headers, cookie_jar, ssl_context) + main_fetch(url, origin, headers, cookie_jar) } // https://fetch.spec.whatwg.org/#concept-main-fetch fn main_fetch(url: &ServoUrl, origin: String, mut headers: Headers, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result { // Step 1. let mut response = None; @@ -375,7 +365,7 @@ fn main_fetch(url: &ServoUrl, // doesn't need to be filtered at all. // Step 12.2. - basic_fetch(url, origin, &mut headers, cookie_jar, ssl_context) + basic_fetch(url, origin, &mut headers, cookie_jar) }); // Step 13. @@ -413,19 +403,17 @@ fn main_fetch(url: &ServoUrl, fn basic_fetch(url: &ServoUrl, origin: String, headers: &mut Headers, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result { // In the case of a WebSocket request, HTTP fetch is always used. - http_fetch(url, origin, headers, cookie_jar, ssl_context) + http_fetch(url, origin, headers, cookie_jar) } // https://fetch.spec.whatwg.org/#concept-http-fetch fn http_fetch(url: &ServoUrl, origin: String, headers: &mut Headers, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result { // Step 1. // Not applicable: with step 3 being useless here, this one is too. @@ -446,7 +434,7 @@ fn http_fetch(url: &ServoUrl, // Not applicable: request's redirect mode is "error". // Step 4.3. - let response = http_network_or_cache_fetch(url, origin, headers, cookie_jar, ssl_context); + let response = http_network_or_cache_fetch(url, origin, headers, cookie_jar); // Step 4.4. // Not applicable: CORS flag is unset. @@ -475,8 +463,7 @@ fn http_fetch(url: &ServoUrl, fn http_network_or_cache_fetch(url: &ServoUrl, origin: String, headers: &mut Headers, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result { // Steps 1-3. // Not applicable: we don't even have a request yet, and there is no body @@ -552,7 +539,7 @@ fn http_network_or_cache_fetch(url: &ServoUrl, // Not applicable: cache mode is "no-store". // Step 22.2. - let forward_response = http_network_fetch(url, headers, cookie_jar, ssl_context); + let forward_response = http_network_fetch(url, headers, cookie_jar); // Step 22.3. // Not applicable: request's method is not unsafe. @@ -581,15 +568,14 @@ fn http_network_or_cache_fetch(url: &ServoUrl, // https://fetch.spec.whatwg.org/#concept-http-network-fetch fn http_network_fetch(url: &ServoUrl, headers: &Headers, - cookie_jar: Arc>, - ssl_context: Arc) + cookie_jar: Arc>) -> Result { // Step 1. // Not applicable: credentials flag is set. // Steps 2-3. // Request's mode is "websocket". - let connection = obtain_a_websocket_connection(url, ssl_context)?; + let connection = obtain_a_websocket_connection(url)?; // Step 4. // Not applicable: request’s body is null. diff --git a/tests/wpt/metadata/websockets/Create-Secure-extensions-empty.htm.ini b/tests/wpt/metadata/websockets/Create-Secure-extensions-empty.htm.ini index 8eb0ae65a7c..e346fdb349d 100644 --- a/tests/wpt/metadata/websockets/Create-Secure-extensions-empty.htm.ini +++ b/tests/wpt/metadata/websockets/Create-Secure-extensions-empty.htm.ini @@ -2,8 +2,8 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be opened] - expected: FAIL - - [W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be closed] expected: NOTRUN + [W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Create-Secure-valid-url-array-protocols.htm.ini b/tests/wpt/metadata/websockets/Create-Secure-valid-url-array-protocols.htm.ini new file mode 100644 index 00000000000..f1617ea3c85 --- /dev/null +++ b/tests/wpt/metadata/websockets/Create-Secure-valid-url-array-protocols.htm.ini @@ -0,0 +1,9 @@ +[Create-Secure-valid-url-array-protocols.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL and array of protocol strings - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL and array of protocol strings - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Create-Secure-valid-url-binaryType-blob.htm.ini b/tests/wpt/metadata/websockets/Create-Secure-valid-url-binaryType-blob.htm.ini new file mode 100644 index 00000000000..592d426f5b9 --- /dev/null +++ b/tests/wpt/metadata/websockets/Create-Secure-valid-url-binaryType-blob.htm.ini @@ -0,0 +1,9 @@ +[Create-Secure-valid-url-binaryType-blob.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - wsocket.binaryType should be set to 'blob' after connection is established - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - wsocket.binaryType should be set to 'blob' after connection is established - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-setCorrectly.htm.ini b/tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-setCorrectly.htm.ini new file mode 100644 index 00000000000..028882a7e6c --- /dev/null +++ b/tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-setCorrectly.htm.ini @@ -0,0 +1,9 @@ +[Create-Secure-valid-url-protocol-setCorrectly.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL and protocol string - protocol should be set correctly - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL and protocol string - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-string.htm.ini b/tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-string.htm.ini new file mode 100644 index 00000000000..6584c7f4bce --- /dev/null +++ b/tests/wpt/metadata/websockets/Create-Secure-valid-url-protocol-string.htm.ini @@ -0,0 +1,9 @@ +[Create-Secure-valid-url-protocol-string.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Check readyState is 1] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL and protocol string - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Create-Secure-valid-url.htm.ini b/tests/wpt/metadata/websockets/Create-Secure-valid-url.htm.ini new file mode 100644 index 00000000000..9b59b18aa14 --- /dev/null +++ b/tests/wpt/metadata/websockets/Create-Secure-valid-url.htm.ini @@ -0,0 +1,9 @@ +[Create-Secure-valid-url.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Pass a valid URL - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-1000-reason.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-1000-reason.htm.ini new file mode 100644 index 00000000000..d24e2785205 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-1000-reason.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-1000-reason.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000, reason) - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000, reason) - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-1000-verify-code.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-1000-verify-code.htm.ini new file mode 100644 index 00000000000..fa15a492ae1 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-1000-verify-code.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-1000-verify-code.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000, reason) - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000, reason) - event.code == 1000 and event.reason = 'Clean Close'] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-1000.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-1000.htm.ini new file mode 100644 index 00000000000..cfe9b1955de --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-1000.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-1000.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000) - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000) - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-1005-verify-code.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-1005-verify-code.htm.ini new file mode 100644 index 00000000000..f9f92433578 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-1005-verify-code.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-1005-verify-code.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close() - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close() - return close code is 1005 - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-1005.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-1005.htm.ini new file mode 100644 index 00000000000..618133c4a71 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-1005.htm.ini @@ -0,0 +1,6 @@ +[Secure-Close-1005.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1005) - see '7.1.5. The WebSocket Connection Close Code' in http://www.ietf.org/rfc/rfc6455.txt] + expected: NOTRUN + diff --git a/tests/wpt/metadata/websockets/Secure-Close-2999-reason.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-2999-reason.htm.ini new file mode 100644 index 00000000000..f1195cfb63f --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-2999-reason.htm.ini @@ -0,0 +1,6 @@ +[Secure-Close-2999-reason.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(2999, reason) - INVALID_ACCESS_ERR is thrown] + expected: NOTRUN + diff --git a/tests/wpt/metadata/websockets/Secure-Close-3000-reason.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-3000-reason.htm.ini new file mode 100644 index 00000000000..63a80322366 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-3000-reason.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-3000-reason.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(3000, reason) - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(3000, reason) - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-3000-verify-code.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-3000-verify-code.htm.ini new file mode 100644 index 00000000000..a5caea6b348 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-3000-verify-code.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-3000-verify-code.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(3000, reason) - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(3000, reason) - verify return code is 3000 - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-4999-reason.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-4999-reason.htm.ini new file mode 100644 index 00000000000..fdd3eca19a8 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-4999-reason.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-4999-reason.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(4999, reason) - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(4999, reason) - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-Reason-124Bytes.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-Reason-124Bytes.htm.ini new file mode 100644 index 00000000000..8c8a0b30597 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-Reason-124Bytes.htm.ini @@ -0,0 +1,6 @@ +[Secure-Close-Reason-124Bytes.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(code, 'reason more than 123 bytes') - SYNTAX_ERR is thrown] + expected: NOTRUN + diff --git a/tests/wpt/metadata/websockets/Secure-Close-Reason-Unpaired-surrogates.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-Reason-Unpaired-surrogates.htm.ini new file mode 100644 index 00000000000..35f9e302c1b --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-Reason-Unpaired-surrogates.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-Reason-Unpaired-surrogates.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(reason with unpaired surrogates) - connection should get opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(reason with unpaired surrogates) - connection should get closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-onlyReason.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-onlyReason.htm.ini new file mode 100644 index 00000000000..65caa5fc292 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-onlyReason.htm.ini @@ -0,0 +1,6 @@ +[Secure-Close-onlyReason.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(only reason) - INVALID_ACCESS_ERR is thrown] + expected: NOTRUN + diff --git a/tests/wpt/metadata/websockets/Secure-Close-readyState-Closed.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-readyState-Closed.htm.ini new file mode 100644 index 00000000000..7308d35ddbe --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-readyState-Closed.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-readyState-Closed.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-readyState-Closing.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-readyState-Closing.htm.ini new file mode 100644 index 00000000000..42bde612fd3 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-readyState-Closing.htm.ini @@ -0,0 +1,6 @@ +[Secure-Close-readyState-Closing.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Close the Connection - readyState should be in CLOSING state just before onclose is called] + expected: NOTRUN + diff --git a/tests/wpt/metadata/websockets/Secure-Close-server-initiated-close.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-server-initiated-close.htm.ini new file mode 100644 index 00000000000..666d661f212 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-server-initiated-close.htm.ini @@ -0,0 +1,9 @@ +[Secure-Close-server-initiated-close.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create Secure WebSocket - Server initiated Close - Client sends back a CLOSE - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create Secure WebSocket - Server initiated Close - Client sends back a CLOSE - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Close-undefined.htm.ini b/tests/wpt/metadata/websockets/Secure-Close-undefined.htm.ini new file mode 100644 index 00000000000..1cdd7f0fbed --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Close-undefined.htm.ini @@ -0,0 +1,6 @@ +[Secure-Close-undefined.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Close Secure WebSocket - Code is undefined] + expected: NOTRUN + diff --git a/tests/wpt/metadata/websockets/Secure-Send-65K-data.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-65K-data.htm.ini new file mode 100644 index 00000000000..8a222b53689 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-65K-data.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-65K-data.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send 65K data on a Secure WebSocket - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send 65K data on a Secure WebSocket - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send 65K data on a Secure WebSocket - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-65K-arraybuffer.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-65K-arraybuffer.htm.ini index db648771b60..cf3ef21a4fa 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-65K-arraybuffer.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-65K-arraybuffer.htm.ini @@ -2,11 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send 65K binary data on a Secure WebSocket - ArrayBuffer - Connection should be opened] - expected: FAIL - - [W3C WebSocket API - Send 65K binary data on a Secure WebSocket - ArrayBuffer - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send 65K binary data on a Secure WebSocket - ArrayBuffer - Connection should be closed] expected: NOTRUN + [W3C WebSocket API - Send 65K binary data on a Secure WebSocket - ArrayBuffer - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send 65K binary data on a Secure WebSocket - ArrayBuffer - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybuffer.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybuffer.htm.ini index 5b5e73cf363..b108cc90ad9 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybuffer.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybuffer.htm.ini @@ -2,11 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a Secure WebSocket - ArrayBuffer - Connection should be opened] - expected: FAIL - - [W3C WebSocket API - Send binary data on a Secure WebSocket - ArrayBuffer - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a Secure WebSocket - ArrayBuffer - Connection should be closed] expected: NOTRUN + [W3C WebSocket API - Send binary data on a Secure WebSocket - ArrayBuffer - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a Secure WebSocket - ArrayBuffer - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-float64.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-float64.htm.ini index 8f3f255ba65..770890e314f 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-float64.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-float64.htm.ini @@ -2,8 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Float64Array - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Float64Array - Connection should be closed] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Float64Array - Connection should be closed] + expected: FAIL + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Float64Array - Connection should be opened] expected: NOTRUN diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-int32.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-int32.htm.ini index c7f8c7bc3e1..f837e0dfeeb 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-int32.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-int32.htm.ini @@ -2,8 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Int32Array - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Int32Array - Connection should be closed] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Int32Array - Connection should be closed] + expected: FAIL + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Int32Array - Connection should be opened] expected: NOTRUN diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint16-offset-length.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint16-offset-length.htm.ini index aa29d8ef6fa..f7ccae7f33c 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint16-offset-length.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint16-offset-length.htm.ini @@ -2,8 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint16Array with offset and length - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint16Array with offset and length - Connection should be closed] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint16Array with offset and length - Connection should be closed] + expected: FAIL + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint16Array with offset and length - Connection should be opened] expected: NOTRUN diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint32-offset.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint32-offset.htm.ini index 09fabbd2f09..845165049d1 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint32-offset.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint32-offset.htm.ini @@ -2,8 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint32Array with offset - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint32Array with offset - Connection should be closed] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint32Array with offset - Connection should be closed] + expected: FAIL + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint32Array with offset - Connection should be opened] expected: NOTRUN diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset-length.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset-length.htm.ini index d6c25b35e51..b3fc5eee805 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset-length.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset-length.htm.ini @@ -2,8 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset and length - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset and length - Connection should be closed] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset and length - Connection should be closed] + expected: FAIL + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset and length - Connection should be opened] expected: NOTRUN diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset.htm.ini index 52128fbd3bd..b72b37663c6 100644 --- a/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset.htm.ini +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-arraybufferview-uint8-offset.htm.ini @@ -2,8 +2,11 @@ type: testharness expected: TIMEOUT [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset - Message should be received] - expected: FAIL - - [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset - Connection should be closed] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset - Connection should be closed] + expected: FAIL + + [W3C WebSocket API - Send binary data on a WebSocket - ArrayBufferView - Uint8Array with offset - Connection should be opened] expected: NOTRUN diff --git a/tests/wpt/metadata/websockets/Secure-Send-binary-blob.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-binary-blob.htm.ini new file mode 100644 index 00000000000..98a1e9ed730 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-binary-blob.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-binary-blob.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send binary data on a Secure WebSocket - Blob - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a Secure WebSocket - Blob - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send binary data on a Secure WebSocket - Blob - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-data.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-data.htm.ini new file mode 100644 index 00000000000..03e423b8a58 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-data.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-data.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send data on a Secure WebSocket - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send data on a Secure WebSocket - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send data on a Secure WebSocket - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-null.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-null.htm.ini new file mode 100644 index 00000000000..8d09d47b317 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-null.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-null.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send null data on a Secure WebSocket - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send null data on a Secure WebSocket - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send null data on a Secure WebSocket - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-paired-surrogates.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-paired-surrogates.htm.ini new file mode 100644 index 00000000000..5075d823173 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-paired-surrogates.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-paired-surrogates.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send paired surrogates data on a Secure WebSocket - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send paired surrogates data on a Secure WebSocket - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send paired surrogates data on a Secure WebSocket - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-unicode-data.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-unicode-data.htm.ini new file mode 100644 index 00000000000..05e61bfb337 --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-unicode-data.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-unicode-data.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send unicode data on a Secure WebSocket - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send unicode data on a Secure WebSocket - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send unicode data on a Secure WebSocket - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/Secure-Send-unpaired-surrogates.htm.ini b/tests/wpt/metadata/websockets/Secure-Send-unpaired-surrogates.htm.ini new file mode 100644 index 00000000000..6e4bffbf4fb --- /dev/null +++ b/tests/wpt/metadata/websockets/Secure-Send-unpaired-surrogates.htm.ini @@ -0,0 +1,12 @@ +[Secure-Send-unpaired-surrogates.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Send unpaired surrogates on a Secure WebSocket - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Send unpaired surrogates on a Secure WebSocket - Message should be received] + expected: NOTRUN + + [W3C WebSocket API - Send unpaired surrogates on a Secure WebSocket - Connection should be closed] + expected: FAIL + diff --git a/tests/wpt/metadata/websockets/binaryType-wrong-value.htm.ini b/tests/wpt/metadata/websockets/binaryType-wrong-value.htm.ini new file mode 100644 index 00000000000..d307c32b021 --- /dev/null +++ b/tests/wpt/metadata/websockets/binaryType-wrong-value.htm.ini @@ -0,0 +1,9 @@ +[binaryType-wrong-value.htm] + type: testharness + expected: TIMEOUT + [W3C WebSocket API - Create WebSocket - set binaryType to something other than blob or arraybuffer - SYNTAX_ERR is returned - Connection should be opened] + expected: NOTRUN + + [W3C WebSocket API - Create WebSocket - set binaryType to something other than blob or arraybuffer - SYNTAX_ERR is returned - Connection should be closed] + expected: FAIL + From 857958f516714005fd1ddf3781948f15f42d395e Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 31 Mar 2017 16:02:40 +0200 Subject: [PATCH 2/4] Revert "Store SSL context in ResourceGroup" This reverts commit 02b2aa159a2019836e799c73ead43f2d189c9e2a. --- components/net/resource_thread.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index b734058ad65..35ce8618301 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -21,7 +21,6 @@ use net_traits::{CustomResponseMediator, ResourceId}; use net_traits::{ResourceThreads, WebSocketCommunicate, WebSocketConnectData}; use net_traits::request::{Request, RequestInit}; use net_traits::storage_thread::StorageThreadMsg; -use openssl::ssl::SslContext; use profile_traits::time::ProfilerChan; use serde::{Deserialize, Serialize}; use serde_json; @@ -47,7 +46,6 @@ pub struct ResourceGroup { cookie_jar: Arc>, auth_cache: Arc>, hsts_list: Arc>, - ssl_context: Arc, connector: Arc>, } @@ -111,14 +109,12 @@ fn create_resource_groups(config_dir: Option<&Path>) cookie_jar: Arc::new(RwLock::new(cookie_jar)), auth_cache: Arc::new(RwLock::new(auth_cache)), hsts_list: Arc::new(RwLock::new(hsts_list.clone())), - ssl_context: ssl_context.clone(), connector: create_http_connector(ssl_context.clone()), }; let private_resource_group = ResourceGroup { cookie_jar: Arc::new(RwLock::new(CookieStorage::new(150))), auth_cache: Arc::new(RwLock::new(AuthCache::new())), hsts_list: Arc::new(RwLock::new(HstsList::new())), - ssl_context: ssl_context.clone(), connector: create_http_connector(ssl_context), }; (resource_group, private_resource_group) @@ -324,12 +320,13 @@ impl CoreResourceManager { init: RequestInit, mut sender: IpcSender, group: &ResourceGroup) { + let ssl_context = create_ssl_context("certs"); let http_state = HttpState { hsts_list: group.hsts_list.clone(), cookie_jar: group.cookie_jar.clone(), auth_cache: group.auth_cache.clone(), // FIXME(#15694): use group.connector.clone() instead. - connector_pool: create_http_connector(group.ssl_context.clone()), + connector_pool: create_http_connector(ssl_context), }; let ua = self.user_agent.clone(); let dc = self.devtools_chan.clone(); From f66cae3f96c1b9a835f2d33477593e083395f402 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 31 Mar 2017 16:02:48 +0200 Subject: [PATCH 3/4] Revert "Introduce create_ssl_context" This reverts commit 7a4632bfa22c8bb83fbfe0c0241411362ee4dffd. --- components/net/connector.rs | 8 ++------ components/net/http_loader.rs | 5 ++--- components/net/resource_thread.rs | 10 ++++------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/components/net/connector.rs b/components/net/connector.rs index 0bd2d225e34..8211e415f34 100644 --- a/components/net/connector.rs +++ b/components/net/connector.rs @@ -27,19 +27,15 @@ const DEFAULT_CIPHERS: &'static str = concat!( "AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA" ); -pub fn create_ssl_context(certificate_file: &str) -> Arc { +pub fn create_http_connector(certificate_file: &str) -> Arc> { let mut context = SslContext::new(SslMethod::Sslv23).unwrap(); context.set_CA_file(&resources_dir_path() .expect("Need certificate file to make network requests") .join(certificate_file)).unwrap(); context.set_cipher_list(DEFAULT_CIPHERS).unwrap(); context.set_options(SSL_OP_NO_SSLV2 | SSL_OP_NO_SSLV3 | SSL_OP_NO_COMPRESSION); - Arc::new(context) -} - -pub fn create_http_connector(ssl_context: Arc) -> Arc> { let connector = HttpsConnector::new(ServoSslClient { - context: ssl_context, + context: Arc::new(context) }); Arc::new(Pool::with_connector(Default::default(), connector)) diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index e8093ffdc0d..8d701de0bbc 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use brotli::Decompressor; -use connector::{Connector, create_http_connector, create_ssl_context}; +use connector::{Connector, create_http_connector}; use cookie; use cookie_storage::CookieStorage; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg, HttpRequest as DevtoolsHttpRequest}; @@ -75,12 +75,11 @@ pub struct HttpState { impl HttpState { pub fn new(certificate_path: &str) -> HttpState { - let ssl_context = create_ssl_context(certificate_path); HttpState { hsts_list: Arc::new(RwLock::new(HstsList::new())), cookie_jar: Arc::new(RwLock::new(CookieStorage::new(150))), auth_cache: Arc::new(RwLock::new(AuthCache::new())), - connector_pool: create_http_connector(ssl_context), + connector_pool: create_http_connector(certificate_path), } } } diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 35ce8618301..5b05bed6810 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ //! A thread that takes a URL and streams back the binary data. -use connector::{Connector, create_http_connector, create_ssl_context}; +use connector::{Connector, create_http_connector}; use cookie; use cookie_rs; use cookie_storage::CookieStorage; @@ -104,18 +104,17 @@ fn create_resource_groups(config_dir: Option<&Path>) read_json_from_file(&mut hsts_list, config_dir, "hsts_list.json"); read_json_from_file(&mut cookie_jar, config_dir, "cookie_jar.json"); } - let ssl_context = create_ssl_context("certs"); let resource_group = ResourceGroup { cookie_jar: Arc::new(RwLock::new(cookie_jar)), auth_cache: Arc::new(RwLock::new(auth_cache)), hsts_list: Arc::new(RwLock::new(hsts_list.clone())), - connector: create_http_connector(ssl_context.clone()), + connector: create_http_connector("certs"), }; let private_resource_group = ResourceGroup { cookie_jar: Arc::new(RwLock::new(CookieStorage::new(150))), auth_cache: Arc::new(RwLock::new(AuthCache::new())), hsts_list: Arc::new(RwLock::new(HstsList::new())), - connector: create_http_connector(ssl_context), + connector: create_http_connector("certs"), }; (resource_group, private_resource_group) } @@ -320,13 +319,12 @@ impl CoreResourceManager { init: RequestInit, mut sender: IpcSender, group: &ResourceGroup) { - let ssl_context = create_ssl_context("certs"); let http_state = HttpState { hsts_list: group.hsts_list.clone(), cookie_jar: group.cookie_jar.clone(), auth_cache: group.auth_cache.clone(), // FIXME(#15694): use group.connector.clone() instead. - connector_pool: create_http_connector(ssl_context), + connector_pool: create_http_connector("certs"), }; let ua = self.user_agent.clone(); let dc = self.devtools_chan.clone(); From e527c9a991c00a3d01fcf262b9fee0b5c948436e Mon Sep 17 00:00:00 2001 From: ddh Date: Wed, 11 Jan 2017 12:07:36 +0000 Subject: [PATCH 4/4] Update Hyper and OpenSSL --- Cargo.lock | 208 ++++++++-------------- components/devtools/Cargo.toml | 4 +- components/devtools_traits/Cargo.toml | 4 +- components/net/Cargo.toml | 12 +- components/net/connector.rs | 50 ++---- components/net/cookie.rs | 51 +++--- components/net/cookie_storage.rs | 50 +++--- components/net/http_loader.rs | 6 +- components/net/lib.rs | 2 +- components/net/resource_thread.rs | 11 +- components/net/subresource_integrity.rs | 10 +- components/net/websocket_loader.rs | 7 +- components/net_traits/Cargo.toml | 7 +- components/net_traits/lib.rs | 70 +------- components/script/Cargo.toml | 6 +- components/script/dom/document.rs | 15 +- components/script/webdriver_handlers.rs | 24 +-- components/script_traits/Cargo.toml | 6 +- components/script_traits/webdriver_msg.rs | 6 +- components/webdriver_server/Cargo.toml | 6 +- components/webdriver_server/lib.rs | 69 +++---- python/servo/bootstrap.py | 2 +- python/servo/build_commands.py | 2 +- python/servo/command_base.py | 2 +- python/servo/package_commands.py | 6 +- python/servo/packages.py | 2 +- tests/unit/net/Cargo.toml | 7 +- tests/unit/net/cookie.rs | 19 +- tests/unit/net/cookie_http_state.rs | 2 +- tests/unit/net/fetch.rs | 5 +- tests/unit/net/http_loader.rs | 22 ++- tests/unit/net/lib.rs | 1 + 32 files changed, 298 insertions(+), 396 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 484417fb79b..8ccd72d16ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,6 +51,11 @@ name = "ansi_term" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "antidote" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "app_units" version = "0.4.0" @@ -468,13 +473,10 @@ dependencies = [ [[package]] name = "cookie" -version = "0.2.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -615,8 +617,8 @@ version = "0.0.1" dependencies = [ "devtools_traits 0.0.1", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -633,8 +635,8 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -877,6 +879,11 @@ dependencies = [ "miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "foreign-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "freetype" version = "0.2.0" @@ -1130,14 +1137,6 @@ dependencies = [ "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hpack" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "html5ever" version = "0.14.1" @@ -1174,33 +1173,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hyper" -version = "0.9.18" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", - "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "hyper_serde" -version = "0.5.1" +name = "hyper-openssl" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", + "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper_serde" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1475,14 +1481,6 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "libressl-pnacl-sys" -version = "2.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "pnacl-build-helper 1.4.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "libservo" version = "0.0.1" @@ -1682,11 +1680,12 @@ version = "0.0.1" dependencies = [ "base64 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "brotli 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", "flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-openssl 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "immeta 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1695,13 +1694,12 @@ dependencies = [ "mime_guess 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", - "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", "profile_traits 0.0.1", "serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-websocket 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-websocket 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo_config 0.0.1", "servo_url 0.0.1", "threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1729,11 +1727,12 @@ dependencies = [ name = "net_tests" version = "0.0.1" dependencies = [ - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", "flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-openssl 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net 0.0.1", @@ -1750,11 +1749,11 @@ dependencies = [ name = "net_traits" version = "0.0.1" dependencies = [ - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "immeta 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1762,7 +1761,6 @@ dependencies = [ "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", "parse-hosts 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1894,45 +1892,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl" -version = "0.7.14" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys-extras 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "openssl-sys-extras" -version = "0.7.14" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "openssl-verify" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2047,14 +2026,6 @@ dependencies = [ "script_plugins 0.0.1", ] -[[package]] -name = "pnacl-build-helper" -version = "1.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "png" version = "0.6.2" @@ -2259,7 +2230,7 @@ dependencies = [ "canvas_traits 0.0.1", "caseless 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "deny_public_fields 0.0.1", "devtools_traits 0.0.1", @@ -2273,8 +2244,8 @@ dependencies = [ "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "js 0.1.4 (git+https://github.com/servo/rust-mozjs)", @@ -2368,14 +2339,14 @@ dependencies = [ "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bluetooth_traits 0.0.1", "canvas_traits 0.0.1", - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "devtools_traits 0.0.1", "euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", "heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -2549,14 +2520,14 @@ dependencies = [ [[package]] name = "servo-websocket" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2697,15 +2668,6 @@ name = "smallvec" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "solicit" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "string_cache" version = "0.4.0" @@ -2922,14 +2884,6 @@ dependencies = [ "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tempdir" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tendril" version = "0.2.3" @@ -3015,7 +2969,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "traitobject" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -3153,12 +3107,12 @@ dependencies = [ [[package]] name = "webdriver" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3170,9 +3124,9 @@ name = "webdriver_server" version = "0.0.1" dependencies = [ "base64 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3185,7 +3139,7 @@ dependencies = [ "servo_url 0.0.1", "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webdriver 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webdriver 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3341,6 +3295,7 @@ dependencies = [ "checksum android_injected_glue 0.2.2 (git+https://github.com/mmatyas/android-rs-injected-glue)" = "" "checksum angle 0.1.2 (git+https://github.com/servo/angle?branch=servo)" = "" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" +"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" "checksum app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a0c3b5be4ed53affe3e1a162b2e7ef9979bcaac80daa9026e9d7988c41e0e83" "checksum arrayvec 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d89f1b0e242270b5b797778af0c8d182a1a2ccac5d8d6fadf414223cc0fab096" "checksum aster 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c9b49e42a449c0b79d8acb91db37621de0978064dca7d3288ddcf030123e5b3" @@ -3374,7 +3329,7 @@ dependencies = [ "checksum cocoa 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a5d0bcb4d345adf9b4ada6c5bb3e2b87c8150b79c46f3f26446de5f4d48de4b" "checksum color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a475fc4af42d83d28adf72968d9bcfaf035a1a9381642d8e85d8a04957767b0d" "checksum compiletest_rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f3f344389765ad7bec166f64c1b39ed6dd2b54d81c4c5dd8af789169351d380c" -"checksum cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0e3d6405328b6edb412158b3b7710e2634e23f3614b9bb1c412df7952489a626" +"checksum cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce776927cd64cbe74ebd1d9b375edb9d1b6bfa808618ddf9548645e019ebdfbb" "checksum core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f51ce3b8ebe311c56de14231eb57572c15abebd2d32b3bcb99bcdb9c101f5ac3" "checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624" "checksum core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ead017dcf77f503dc991f6b52de6084eeea60a94b0a652baa9bf88654a28e83f" @@ -3410,6 +3365,7 @@ dependencies = [ "checksum flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "d4e4d0c15ef829cbc1b7cda651746be19cceeb238be7b1049227b14891df9e25" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum fontsan 0.3.2 (git+https://github.com/servo/fontsan)" = "" +"checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" "checksum freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fde23272c687e4570aefec06cb71174ec0f5284b725deac4e77ba2665d635faf" "checksum futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "51f93f3de6ba1794dcd5810b3546d004600a59a98266487c8407bc4b24e398f3" "checksum gamma-lut 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8728df930776135895cbb25cbdd17791cde7d4285d53cf58fe6ee2e6412455" @@ -3427,12 +3383,12 @@ dependencies = [ "checksum heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "46f96d52fb1564059fc97b85ef6165728cc30198ab60073bf114c66c4c89bb5d" "checksum heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad003ce233955e9d95f2c69cde84e68302ba9ba4a673d351c9bff93c738aadc" "checksum heartbeats-simple-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1a408c0011427cc0e0049f7861c70377819aedfc006e8c901b1c70fd98fb1a4" -"checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58" "checksum html5ever 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c28216b1b9d20ef7407d8d633a3c1c4ec9a529ee661184aac0a03876709bd6b8" "checksum html5ever-atoms 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f9bd86e3b6a5a7933a272cc0a854f24e371f31576e585c0b41e8f857270c5134" "checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d" -"checksum hyper 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9bf64f730d6ee4b0528a5f0a316363da9d8104318731509d4ccc86248f82b3" -"checksum hyper_serde 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d602a93073c250f49b2e2d931cc1755a5f447824154dc3c711716dee29bd7486" +"checksum hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)" = "43a15e3273b2133aaac0150478ab443fb89f15c3de41d8d93d8f3bb14bf560f6" +"checksum hyper-openssl 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5ac3d814565b8a91446678e6c472f9889c99b0ec12c92279e46fc2530f017c35" +"checksum hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a43d985c58afed6b59991932e1d9b5f2629472849f0062c0078d82fdc0b788bb" "checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" "checksum image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "979bad0502082fd60053a490282e87d6c89650942e3a270e0d4c83569c7f5899" "checksum immeta 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0b9260463a221bfe3f02100c56e2d14c050d5ffe7e44a43d0a1b2b1f2b523502" @@ -3452,7 +3408,6 @@ dependencies = [ "checksum leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40a8225d44241fd324a8af2806ba635fc7c8a7e9a7de4d5cf3ef54e71f5926fc" "checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135" "checksum libloading 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fd1835a714c1f67ba073a493493c23686a480e2614e208c921834808b1f19d8f" -"checksum libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cbc058951ab6a3ef35ca16462d7642c4867e6403520811f28537a4e2f2db3e71" "checksum libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e5ee912a45d686d393d5ac87fac15ba0ba18daae14e8e7543c63ebf7fb7e970c" "checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad" "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" @@ -3484,10 +3439,8 @@ dependencies = [ "checksum ogg 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "013b78ceb7fb82555a2f8a95d8e40866fe64a5d15b83c51b3e1fdd40cd903ed3" "checksum ogg_metadata 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1753e64956b3afd900f788bf6d2e9d0986df39168be86f4b47ec2058d0c2f7" "checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" -"checksum openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "c4117b6244aac42ed0150a6019b4d953d28247c5dd6ae6f46ae469b5f2318733" -"checksum openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)" = "89c47ee94c352eea9ddaf8e364be7f978a3bb6d66d73176572484238dd5a5c3f" -"checksum openssl-sys-extras 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "11c5e1dba7d3d03d80f045bf0d60111dc69213b67651e7c889527a3badabb9fa" -"checksum openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ed86cce894f6b0ed4572e21eb34026f1dc8869cb9ee3869029131bc8c3feb2d" +"checksum openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8aa0eb7aad44f0da6f7dda13ddb4559d91a0f40cfab150b1f76ad5b39ec523f" +"checksum openssl-sys 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "14f5bfd12054d764510b887152d564ba11d99ae24ea7d740781778f646620576" "checksum ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da12c96037889ae0be29dd2bdd260e5a62a7df24e6466d5a15bb8131c1c200a8" "checksum osmesa-src 12.0.1 (git+https://github.com/servo/osmesa-src)" = "" "checksum osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" @@ -3501,7 +3454,6 @@ dependencies = [ "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum pnacl-build-helper 1.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "61c9231d31aea845007443d62fcbb58bb6949ab9c18081ee1e09920e0cf1118b" "checksum png 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3cb773e9a557edb568ce9935cf783e3cdcabe06a9449d41b3e5506d88e582c82" "checksum procedural-masquerade 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260" "checksum quasi 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dcbf815446dc6a0afbc72d88f9a8aa71b608d10b168e09437c80c0fd6fd410c9" @@ -3531,7 +3483,7 @@ dependencies = [ "checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b" "checksum servo-glutin 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17f541bd4b5a709d5133349e731379c6d74c3946f3b509d4fa8204f1833f9067" "checksum servo-skia 0.30000004.1 (registry+https://github.com/rust-lang/crates.io-index)" = "22ba980da523e91b9d2f7da9fb35f721138a1e604b8d8191e56f403e4760a9e4" -"checksum servo-websocket 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a7445fde9aacb9a1f493652ab02ac0fb7a8bfe1e6cd762f7bd44b839a5d5e4c" +"checksum servo-websocket 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a1ff13c5d852c2793805226e688044309f2c1d8f063784805a13e99cb75b611" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a" "checksum shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72f20b8f3c060374edb8046591ba28f62448c369ccbdc7b02075103fb3a9e38d" @@ -3541,7 +3493,6 @@ dependencies = [ "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum smallvec 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dca03f2f42500a9ef8ac0d16183dff8bed40e3dcf98f9d4147928548d5c4236e" -"checksum solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "172382bac9424588d7840732b250faeeef88942e37b6e35317dce98cafdd75b2" "checksum string_cache 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c19dbe4d2552673a8c4ec0e91523670ee2b73ba3560d935703ce5d64a40f864c" "checksum string_cache_codegen 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0c9dfe1a7c8bba1ecb90730d269fdc08afe93d23c28dd6c4aa5cabd79a05a05e" "checksum string_cache_shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc" @@ -3554,7 +3505,6 @@ dependencies = [ "checksum syntex_pos 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8df3921c7945dfb9ffc53aa35adb2cf4313b5ab5f079c3619b3d4eb82a0efc2b" "checksum syntex_syntax 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc960085bae44591e22d01f6c0e82a8aec832f8659aca556cdf8ecbdac2bb47b" "checksum target_build_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f42dc058080c19c6a58bdd1bf962904ee4f5ef1fe2a81b529f31dacc750c679f" -"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" "checksum tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cebf864c2d90394a1b66d6fe45963f9a177f2af81a0edea5060f77627f9c4587" "checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" "checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a" @@ -3565,7 +3515,7 @@ dependencies = [ "checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" "checksum tinyfiledialogs 2.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d401358cd71aca93d5f4fccd3db5b87d970ae70fe457911929d99f4a87f7531" "checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" -"checksum traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "07eaeb7689bb7fca7ce15628319635758eda769fed481ecfe6686ddef2600616" +"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum truetype 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec30350633d6dac9dc1a625786b6cbe9150664be941aac2c35ad7199eab877" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" @@ -3585,7 +3535,7 @@ dependencies = [ "checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" -"checksum webdriver 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdc28802daddee94267a657ffeac2593a33881fb7a3a44fedd320b1319efcaf6" +"checksum webdriver 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d548aabf87411b1b4ba91fd07eacd8b238135c7131a452b8a9f6386209167e18" "checksum webrender 0.26.0 (git+https://github.com/servo/webrender)" = "" "checksum webrender_traits 0.27.0 (git+https://github.com/servo/webrender)" = "" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" diff --git a/components/devtools/Cargo.toml b/components/devtools/Cargo.toml index d1d35ddafca..9b5a2164bb8 100644 --- a/components/devtools/Cargo.toml +++ b/components/devtools/Cargo.toml @@ -12,8 +12,8 @@ path = "lib.rs" [dependencies] devtools_traits = {path = "../devtools_traits"} encoding = "0.2" -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper_serde = "0.6" ipc-channel = "0.7" log = "0.3.5" msg = {path = "../msg"} diff --git a/components/devtools_traits/Cargo.toml b/components/devtools_traits/Cargo.toml index 542c803b8e9..de38e54dabd 100644 --- a/components/devtools_traits/Cargo.toml +++ b/components/devtools_traits/Cargo.toml @@ -13,8 +13,8 @@ path = "lib.rs" bitflags = "0.7" heapsize = "0.3.0" heapsize_derive = "0.1" -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper_serde = "0.6" ipc-channel = "0.7" msg = {path = "../msg"} serde = "0.9" diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml index 22366e90c5c..baea03a2ad2 100644 --- a/components/net/Cargo.toml +++ b/components/net/Cargo.toml @@ -12,11 +12,12 @@ path = "lib.rs" [dependencies] base64 = "0.4.1" brotli = "1.0.6" -cookie = "0.2.5" +cookie = "0.6" devtools_traits = {path = "../devtools_traits"} flate2 = "0.2.0" -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper_serde = "0.6" +hyper-openssl = "0.2.2" immeta = "0.3.1" ipc-channel = "0.7" log = "0.3.5" @@ -25,15 +26,14 @@ mime = "0.2.1" mime_guess = "1.8.0" msg = {path = "../msg"} net_traits = {path = "../net_traits"} -openssl = "0.7.6" -openssl-verify = "0.1" +openssl = "0.9" profile_traits = {path = "../profile_traits"} serde = "0.9" serde_derive = "0.9" serde_json = "0.9" servo_config = {path = "../config"} servo_url = {path = "../url"} -servo-websocket = "0.18" +servo-websocket = "0.19" threadpool = "1.0" time = "0.1.17" unicase = "1.4.0" diff --git a/components/net/connector.rs b/components/net/connector.rs index 8211e415f34..4d9ddcdab11 100644 --- a/components/net/connector.rs +++ b/components/net/connector.rs @@ -2,14 +2,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use hyper; use hyper::client::Pool; -use hyper::net::{HttpStream, HttpsConnector, SslClient}; -use openssl::ssl::{SSL_OP_NO_COMPRESSION, SSL_OP_NO_SSLV2, SSL_OP_NO_SSLV3, SSL_VERIFY_PEER}; -use openssl::ssl::{Ssl, SslContext, SslMethod, SslStream}; +use hyper_openssl; +use openssl::ssl::{SSL_OP_NO_COMPRESSION, SSL_OP_NO_SSLV2, SSL_OP_NO_SSLV3}; +use openssl::ssl::{SslConnectorBuilder, SslMethod}; use servo_config::resource_files::resources_dir_path; use std::sync::Arc; -pub type Connector = HttpsConnector; +pub type Connector = hyper::net::HttpsConnector; // The basic logic here is to prefer ciphers with ECDSA certificates, Forward // Secrecy, AES GCM ciphers, AES ciphers, and finally 3DES ciphers. @@ -28,33 +29,20 @@ const DEFAULT_CIPHERS: &'static str = concat!( ); pub fn create_http_connector(certificate_file: &str) -> Arc> { - let mut context = SslContext::new(SslMethod::Sslv23).unwrap(); - context.set_CA_file(&resources_dir_path() - .expect("Need certificate file to make network requests") - .join(certificate_file)).unwrap(); - context.set_cipher_list(DEFAULT_CIPHERS).unwrap(); - context.set_options(SSL_OP_NO_SSLV2 | SSL_OP_NO_SSLV3 | SSL_OP_NO_COMPRESSION); - let connector = HttpsConnector::new(ServoSslClient { - context: Arc::new(context) - }); + let ca_file = &resources_dir_path() + .expect("Need certificate file to make network requests") + .join(certificate_file); - Arc::new(Pool::with_connector(Default::default(), connector)) -} - -pub struct ServoSslClient { - context: Arc, -} - -impl SslClient for ServoSslClient { - type Stream = SslStream; - - fn wrap_client(&self, stream: HttpStream, host: &str) -> Result { - let mut ssl = try!(Ssl::new(&self.context)); - try!(ssl.set_hostname(host)); - let host = host.to_owned(); - ssl.set_verify_callback(SSL_VERIFY_PEER, move |p, x| { - ::openssl_verify::verify_callback(&host, p, x) - }); - SslStream::connect(ssl, stream).map_err(From::from) + let mut ssl_connector_builder = SslConnectorBuilder::new(SslMethod::tls()).unwrap(); + { + let context = ssl_connector_builder.builder_mut(); + context.set_ca_file(ca_file).expect("could not set CA file"); + context.set_cipher_list(DEFAULT_CIPHERS).expect("could not set ciphers"); + context.set_options(SSL_OP_NO_SSLV2 | SSL_OP_NO_SSLV3 | SSL_OP_NO_COMPRESSION); } + let ssl_connector = ssl_connector_builder.build(); + let ssl_client = hyper_openssl::OpensslClient::from(ssl_connector); + let https_connector = hyper::net::HttpsConnector::new(ssl_client); + + Arc::new(Pool::with_connector(Default::default(), https_connector)) } diff --git a/components/net/cookie.rs b/components/net/cookie.rs index 45fe1403e58..0f34dff0e54 100644 --- a/components/net/cookie.rs +++ b/components/net/cookie.rs @@ -21,7 +21,7 @@ use time::{Tm, now, at, Duration}; pub struct Cookie { #[serde(deserialize_with = "hyper_serde::deserialize", serialize_with = "hyper_serde::serialize")] - pub cookie: cookie_rs::Cookie, + pub cookie: cookie_rs::Cookie<'static>, pub host_only: bool, pub persistent: bool, #[serde(deserialize_with = "hyper_serde::deserialize", @@ -34,27 +34,35 @@ pub struct Cookie { } impl Cookie { + pub fn from_cookie_string(cookie_str: String, request: &ServoUrl, + source: CookieSource) -> Option { + cookie_rs::Cookie::parse(cookie_str) + .ok() + .map(|cookie| Cookie::new_wrapped(cookie, request, source)) + .unwrap_or(None) + } + /// http://tools.ietf.org/html/rfc6265#section-5.3 - pub fn new_wrapped(mut cookie: cookie_rs::Cookie, request: &ServoUrl, source: CookieSource) + pub fn new_wrapped(mut cookie: cookie_rs::Cookie<'static>, request: &ServoUrl, source: CookieSource) -> Option { // Step 3 - let (persistent, expiry_time) = match (&cookie.max_age, &cookie.expires) { - (&Some(max_age), _) => { - (true, Some(at(now().to_timespec() + Duration::seconds(max_age as i64)))) + let (persistent, expiry_time) = match (cookie.max_age(), cookie.expires()) { + (Some(max_age), _) => { + (true, Some(at(now().to_timespec() + Duration::seconds(max_age.num_seconds())))) } - (_, &Some(expires)) => (true, Some(expires)), + (_, Some(expires)) => (true, Some(expires)), _ => (false, None) }; let url_host = request.host_str().unwrap_or("").to_owned(); // Step 4 - let mut domain = cookie.domain.clone().unwrap_or("".to_owned()); + let mut domain = cookie.domain().unwrap_or("").to_owned(); // Step 5 if is_pub_domain(&domain) { if domain == url_host { - domain = "".to_owned(); + domain = "".to_string(); } else { return None } @@ -65,24 +73,24 @@ impl Cookie { if !Cookie::domain_match(&url_host, &domain) { return None; } else { - cookie.domain = Some(domain); + cookie.set_domain(domain); false } } else { - cookie.domain = Some(url_host); + cookie.set_domain(url_host); true }; // Step 7 - let mut path = cookie.path.unwrap_or("".to_owned()); + let mut path = cookie.path().unwrap_or("").to_owned(); if path.chars().next() != Some('/') { - path = Cookie::default_path(request.path()).to_owned(); + path = Cookie::default_path(&request.path().to_owned()).to_string(); } - cookie.path = Some(path); + cookie.set_path(path); // Step 10 - if cookie.httponly && source == CookieSource::NonHTTP { + if cookie.http_only() && source == CookieSource::NonHTTP { return None; } @@ -139,8 +147,9 @@ impl Cookie { // http://tools.ietf.org/html/rfc6265#section-5.1.3 pub fn domain_match(string: &str, domain_string: &str) -> bool { - debug_assert!(string.to_lowercase() == string); - debug_assert!(domain_string.to_lowercase() == domain_string); + let string = &string.to_lowercase(); + let domain_string = &domain_string.to_lowercase(); + string == domain_string || (string.ends_with(domain_string) && string.as_bytes()[string.len()-domain_string.len()-1] == b'.' && @@ -152,27 +161,27 @@ impl Cookie { pub fn appropriate_for_url(&self, url: &ServoUrl, source: CookieSource) -> bool { let domain = url.host_str(); if self.host_only { - if self.cookie.domain.as_ref().map(String::as_str) != domain { + if self.cookie.domain() != domain { return false; } } else { - if let (Some(domain), &Some(ref cookie_domain)) = (domain, &self.cookie.domain) { + if let (Some(domain), &Some(ref cookie_domain)) = (domain, &self.cookie.domain()) { if !Cookie::domain_match(domain, cookie_domain) { return false; } } } - if let Some(ref cookie_path) = self.cookie.path { + if let Some(ref cookie_path) = self.cookie.path() { if !Cookie::path_match(url.path(), cookie_path) { return false; } } - if self.cookie.secure && !url.is_secure_scheme() { + if self.cookie.secure() && !url.is_secure_scheme() { return false; } - if self.cookie.httponly && source == CookieSource::NonHTTP { + if self.cookie.http_only() && source == CookieSource::NonHTTP { return false; } diff --git a/components/net/cookie_storage.rs b/components/net/cookie_storage.rs index 7ea4eecd685..f255f57b56d 100644 --- a/components/net/cookie_storage.rs +++ b/components/net/cookie_storage.rs @@ -34,20 +34,20 @@ impl CookieStorage { // http://tools.ietf.org/html/rfc6265#section-5.3 pub fn remove(&mut self, cookie: &Cookie, url: &ServoUrl, source: CookieSource) -> Result, ()> { - let domain = reg_host(cookie.cookie.domain.as_ref().unwrap_or(&"".to_string())); + let domain = reg_host(cookie.cookie.domain().as_ref().unwrap_or(&"")); let cookies = self.cookies_map.entry(domain).or_insert(vec![]); // https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt Step 2 - if !cookie.cookie.secure && !url.is_secure_scheme() { - let new_domain = cookie.cookie.domain.as_ref().unwrap(); - let new_path = cookie.cookie.path.as_ref().unwrap(); + if !cookie.cookie.secure() && !url.is_secure_scheme() { + let new_domain = cookie.cookie.domain().as_ref().unwrap().to_owned(); + let new_path = cookie.cookie.path().as_ref().unwrap().to_owned(); let any_overlapping = cookies.iter().any(|c| { - let existing_domain = c.cookie.domain.as_ref().unwrap(); - let existing_path = c.cookie.path.as_ref().unwrap(); + let existing_domain = c.cookie.domain().as_ref().unwrap().to_owned(); + let existing_path = c.cookie.path().as_ref().unwrap().to_owned(); - c.cookie.name == cookie.cookie.name && - c.cookie.secure && + c.cookie.name() == cookie.cookie.name() && + c.cookie.secure() && (Cookie::domain_match(new_domain, existing_domain) || Cookie::domain_match(existing_domain, new_domain)) && Cookie::path_match(new_path, existing_path) @@ -60,9 +60,9 @@ impl CookieStorage { // Step 11.1 let position = cookies.iter().position(|c| { - c.cookie.domain == cookie.cookie.domain && - c.cookie.path == cookie.cookie.path && - c.cookie.name == cookie.cookie.name + c.cookie.domain() == cookie.cookie.domain() && + c.cookie.path() == cookie.cookie.path() && + c.cookie.name() == cookie.cookie.name() }); if let Some(ind) = position { @@ -70,7 +70,7 @@ impl CookieStorage { let c = cookies.remove(ind); // http://tools.ietf.org/html/rfc6265#section-5.3 step 11.2 - if c.cookie.httponly && source == CookieSource::NonHTTP { + if c.cookie.http_only() && source == CookieSource::NonHTTP { // Undo the removal. cookies.push(c); Err(()) @@ -85,7 +85,7 @@ impl CookieStorage { // http://tools.ietf.org/html/rfc6265#section-5.3 pub fn push(&mut self, mut cookie: Cookie, url: &ServoUrl, source: CookieSource) { // https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt Step 1 - if cookie.cookie.secure && !url.is_secure_scheme() { + if cookie.cookie.secure() && !url.is_secure_scheme() { return; } @@ -102,7 +102,7 @@ impl CookieStorage { } // Step 12 - let domain = reg_host(&cookie.cookie.domain.as_ref().unwrap_or(&"".to_string())); + let domain = reg_host(&cookie.cookie.domain().as_ref().unwrap_or(&"")); let mut cookies = self.cookies_map.entry(domain).or_insert(vec![]); if cookies.len() == self.max_per_host { @@ -111,7 +111,7 @@ impl CookieStorage { let new_len = cookies.len(); // https://www.ietf.org/id/draft-ietf-httpbis-cookie-alone-01.txt - if new_len == old_len && !evict_one_cookie(cookie.cookie.secure, cookies) { + if new_len == old_len && !evict_one_cookie(cookie.cookie.secure(), cookies) { return; } } @@ -119,8 +119,8 @@ impl CookieStorage { } pub fn cookie_comparator(a: &Cookie, b: &Cookie) -> Ordering { - let a_path_len = a.cookie.path.as_ref().map_or(0, |p| p.len()); - let b_path_len = b.cookie.path.as_ref().map_or(0, |p| p.len()); + let a_path_len = a.cookie.path().as_ref().map_or(0, |p| p.len()); + let b_path_len = b.cookie.path().as_ref().map_or(0, |p| p.len()); match a_path_len.cmp(&b_path_len) { Ordering::Equal => { let a_creation_time = a.creation_time.to_timespec(); @@ -137,10 +137,10 @@ impl CookieStorage { pub fn cookies_for_url(&mut self, url: &ServoUrl, source: CookieSource) -> Option { let filterer = |c: &&mut Cookie| -> bool { info!(" === SENT COOKIE : {} {} {:?} {:?}", - c.cookie.name, - c.cookie.value, - c.cookie.domain, - c.cookie.path); + c.cookie.name(), + c.cookie.value(), + c.cookie.domain(), + c.cookie.path()); info!(" === SENT COOKIE RESULT {}", c.appropriate_for_url(url, source)); // Step 1 @@ -161,7 +161,7 @@ impl CookieStorage { (match acc.len() { 0 => acc, _ => acc + "; ", - }) + &c.cookie.name + "=" + &c.cookie.value + }) + &c.cookie.name() + "=" + &c.cookie.value() }; let result = url_cookies.iter_mut().fold("".to_owned(), reducer); @@ -175,7 +175,7 @@ impl CookieStorage { pub fn cookies_data_for_url<'a>(&'a mut self, url: &'a ServoUrl, source: CookieSource) - -> Box + 'a> { + -> Box> + 'a> { let domain = reg_host(url.host_str().unwrap_or("")); let cookies = self.cookies_map.entry(domain).or_insert(vec![]); @@ -187,7 +187,7 @@ impl CookieStorage { } fn reg_host<'a>(url: &'a str) -> String { - reg_suffix(url).to_string() + reg_suffix(url).to_lowercase() } fn is_cookie_expired(cookie: &Cookie) -> bool { @@ -219,7 +219,7 @@ fn evict_one_cookie(is_secure_cookie: bool, cookies: &mut Vec) -> bool { fn get_oldest_accessed(is_secure_cookie: bool, cookies: &mut Vec) -> Option<(usize, Tm)> { let mut oldest_accessed: Option<(usize, Tm)> = None; for (i, c) in cookies.iter().enumerate() { - if (c.cookie.secure == is_secure_cookie) && + if (c.cookie.secure() == is_secure_cookie) && oldest_accessed.as_ref().map_or(true, |a| c.last_access < a.1) { oldest_accessed = Some((i, c.last_access)); } diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index 8d701de0bbc..3d61d741efc 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -27,6 +27,7 @@ use hyper::header::Origin as HyperOrigin; use hyper::method::Method; use hyper::net::{Fresh, HttpStream, HttpsStream, NetworkConnector}; use hyper::status::StatusCode; +use hyper_openssl::SslStream; use hyper_serde::Serde; use log; use msg::constellation_msg::PipelineId; @@ -35,7 +36,6 @@ use net_traits::hosts::replace_host; use net_traits::request::{CacheMode, CredentialsMode, Destination, Origin}; use net_traits::request::{RedirectMode, Referrer, Request, RequestMode, ResponseTainting}; use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType}; -use openssl::ssl::SslStream; use resource_thread::AuthCache; use servo_url::{ImmutableOrigin, ServoUrl}; use std::collections::HashSet; @@ -257,8 +257,8 @@ fn set_cookie_for_url(cookie_jar: &Arc>, let header = Header::parse_header(&[cookie_val.into_bytes()]); if let Ok(SetCookie(cookies)) = header { - for bare_cookie in cookies { - if let Some(cookie) = cookie::Cookie::new_wrapped(bare_cookie, request, source) { + for cookie in cookies { + if let Some(cookie) = cookie::Cookie::from_cookie_string(cookie, request, source) { cookie_jar.push(cookie, request, source); } } diff --git a/components/net/lib.rs b/components/net/lib.rs index 95484b8a0cd..648118d10c0 100644 --- a/components/net/lib.rs +++ b/components/net/lib.rs @@ -12,6 +12,7 @@ extern crate cookie as cookie_rs; extern crate devtools_traits; extern crate flate2; extern crate hyper; +extern crate hyper_openssl; extern crate hyper_serde; extern crate immeta; extern crate ipc_channel; @@ -23,7 +24,6 @@ extern crate mime_guess; extern crate msg; extern crate net_traits; extern crate openssl; -extern crate openssl_verify; extern crate profile_traits; extern crate serde; #[macro_use] diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 5b05bed6810..46f3c9d53a2 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -148,6 +148,7 @@ impl ResourceChannelManager { } } + /// Returns false if the thread should exit. fn process_msg(&mut self, msg: CoreResourceMsg, @@ -158,10 +159,10 @@ impl ResourceChannelManager { CoreResourceMsg::WebsocketConnect(connect, connect_data) => self.resource_manager.websocket_connect(connect, connect_data, group), CoreResourceMsg::SetCookieForUrl(request, cookie, source) => - self.resource_manager.set_cookie_for_url(&request, cookie, source, group), + self.resource_manager.set_cookie_for_url(&request, cookie.into_inner(), source, group), CoreResourceMsg::SetCookiesForUrl(request, cookies, source) => { for cookie in cookies { - self.resource_manager.set_cookie_for_url(&request, cookie.0, source, group); + self.resource_manager.set_cookie_for_url(&request, cookie.into_inner(), source, group); } } CoreResourceMsg::GetCookiesForUrl(url, consumer, source) => { @@ -307,9 +308,11 @@ impl CoreResourceManager { } } - fn set_cookie_for_url(&mut self, request: &ServoUrl, cookie: cookie_rs::Cookie, source: CookieSource, + fn set_cookie_for_url(&mut self, request: &ServoUrl, + cookie: cookie_rs::Cookie<'static>, + source: CookieSource, resource_group: &ResourceGroup) { - if let Some(cookie) = cookie::Cookie::new_wrapped(cookie, &request, source) { + if let Some(cookie) = cookie::Cookie::new_wrapped(cookie, request, source) { let mut cookie_jar = resource_group.cookie_jar.write().unwrap(); cookie_jar.push(cookie, request, source) } diff --git a/components/net/subresource_integrity.rs b/components/net/subresource_integrity.rs index bddef7d18a8..68cc6b7c930 100644 --- a/components/net/subresource_integrity.rs +++ b/components/net/subresource_integrity.rs @@ -4,7 +4,7 @@ use base64; use net_traits::response::{Response, ResponseBody, ResponseType}; -use openssl::crypto::hash::{hash, Type as MessageDigest}; +use openssl::hash::{MessageDigest, hash}; use std::iter::Filter; use std::str::Split; use std::sync::MutexGuard; @@ -119,7 +119,7 @@ fn apply_algorithm_to_response(body: MutexGuard, message_digest: MessageDigest) -> String { if let ResponseBody::Done(ref vec) = *body { - let response_digest = hash(message_digest, vec); + let response_digest = hash(message_digest, vec).unwrap(); base64::encode(&response_digest) } else { unreachable!("Tried to calculate digest of incomplete response body") @@ -156,9 +156,9 @@ pub fn is_response_integrity_valid(integrity_metadata: &str, response: &Response let digest = item.val; let message_digest = match &*algorithm { - "sha256" => MessageDigest::SHA256, - "sha384" => MessageDigest::SHA384, - "sha512" => MessageDigest::SHA512, + "sha256" => MessageDigest::sha256(), + "sha384" => MessageDigest::sha384(), + "sha512" => MessageDigest::sha512(), _ => continue, }; diff --git a/components/net/websocket_loader.rs b/components/net/websocket_loader.rs index ae40026614c..c4670d6b727 100644 --- a/components/net/websocket_loader.rs +++ b/components/net/websocket_loader.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cookie::Cookie; +use cookie_rs; use cookie_storage::CookieStorage; use fetch::methods::{should_be_blocked_due_to_bad_port, should_be_blocked_due_to_nosniff}; use http_loader::{is_redirect_status, set_request_cookies}; @@ -596,8 +597,10 @@ fn http_network_fetch(url: &ServoUrl, if let Some(cookies) = response.headers.get::() { let mut jar = cookie_jar.write().unwrap(); for cookie in &**cookies { - if let Some(cookie) = Cookie::new_wrapped(cookie.clone(), url, CookieSource::HTTP) { - jar.push(cookie, url, CookieSource::HTTP); + if let Ok(cookie) = cookie_rs::Cookie::parse(&**cookie) { + if let Some(cookie) = Cookie::new_wrapped(cookie.into_owned(), url, CookieSource::HTTP) { + jar.push(cookie, url, CookieSource::HTTP); + } } } } diff --git a/components/net_traits/Cargo.toml b/components/net_traits/Cargo.toml index 5005d764b9a..2d824212d6c 100644 --- a/components/net_traits/Cargo.toml +++ b/components/net_traits/Cargo.toml @@ -10,11 +10,11 @@ name = "net_traits" path = "lib.rs" [dependencies] -cookie = "0.2.5" +cookie = "0.6" heapsize = "0.3.0" heapsize_derive = "0.1" -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper_serde = "0.6" image = "0.12" immeta = "0.3.1" ipc-channel = "0.7" @@ -22,7 +22,6 @@ lazy_static = "0.2" log = "0.3.5" msg = {path = "../msg"} num-traits = "0.1.32" -openssl = "0.7.6" parse-hosts = "0.3.0" serde = "0.9" serde_derive = "0.9" diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs index ab0121a119c..8966a7ce276 100644 --- a/components/net_traits/lib.rs +++ b/components/net_traits/lib.rs @@ -22,7 +22,6 @@ extern crate lazy_static; extern crate log; extern crate msg; extern crate num_traits; -extern crate openssl; extern crate parse_hosts; extern crate serde; #[macro_use] @@ -44,7 +43,6 @@ use hyper_serde::Serde; use ipc_channel::Error as IpcError; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; -use openssl::ssl::error::{OpensslError, SslError}; use request::{Request, RequestInit}; use response::{HttpsState, Response}; use servo_url::ServoUrl; @@ -377,17 +375,13 @@ pub enum CoreResourceMsg { /// Try to make a websocket connection to a URL. WebsocketConnect(WebSocketCommunicate, WebSocketConnectData), /// Store a cookie for a given originating URL - SetCookieForUrl(ServoUrl, - #[serde(deserialize_with = "::hyper_serde::deserialize", - serialize_with = "::hyper_serde::serialize")] - Cookie, - CookieSource), - /// Store cookies for a given originating URL - SetCookiesForUrl(ServoUrl, Vec>, CookieSource), + SetCookieForUrl(ServoUrl, Serde>, CookieSource), + /// Store a set of cookies for a given originating URL + SetCookiesForUrl(ServoUrl, Vec>>, CookieSource), /// Retrieve the stored cookies for a given URL GetCookiesForUrl(ServoUrl, IpcSender>, CookieSource), /// Get a cookie by name for a given originating URL - GetCookiesDataForUrl(ServoUrl, IpcSender>>, CookieSource), + GetCookiesDataForUrl(ServoUrl, IpcSender>>>, CookieSource), /// Cancel a network request corresponding to a given `ResourceId` Cancel(ResourceId), /// Synchronization message solely for knowing the state of the ResourceChannelManager loop @@ -533,63 +527,13 @@ pub enum NetworkError { impl NetworkError { pub fn from_hyper_error(url: &ServoUrl, error: HyperError) -> Self { if let HyperError::Ssl(ref ssl_error) = error { - if let Some(ssl_error) = ssl_error.downcast_ref::() { - return NetworkError::from_ssl_error(url, ssl_error); - } + return NetworkError::from_ssl_error(url, &**ssl_error); } NetworkError::Internal(error.description().to_owned()) } - pub fn from_ssl_error(url: &ServoUrl, error: &SslError) -> Self { - if let SslError::OpenSslErrors(ref errors) = *error { - if errors.iter().any(is_cert_verify_error) { - let mut error_report = vec![format!("ssl error ({}):", openssl::version::version())]; - let mut suggestion = None; - for err in errors { - if is_unknown_message_digest_err(err) { - suggestion = Some("Servo recommends upgrading to a newer OpenSSL version."); - } - error_report.push(format_ssl_error(err)); - } - - if let Some(suggestion) = suggestion { - error_report.push(suggestion.to_owned()); - } - - let error_report = error_report.join("
\n"); - return NetworkError::SslValidation(url.clone(), error_report); - } - } - NetworkError::Internal(error.description().to_owned()) - } -} - -fn format_ssl_error(error: &OpensslError) -> String { - match error { - &OpensslError::UnknownError { ref library, ref function, ref reason } => { - format!("{}: {} - {}", library, function, reason) - } - } -} - -// FIXME: This incredibly hacky. Make it more robust, and at least test it. -fn is_cert_verify_error(error: &OpensslError) -> bool { - match error { - &OpensslError::UnknownError { ref library, ref function, ref reason } => { - library == "SSL routines" && - function.to_uppercase() == "SSL3_GET_SERVER_CERTIFICATE" && - reason == "certificate verify failed" - } - } -} - -fn is_unknown_message_digest_err(error: &OpensslError) -> bool { - match error { - &OpensslError::UnknownError { ref library, ref function, ref reason } => { - library == "asn1 encoding routines" && - function == "ASN1_item_verify" && - reason == "unknown message digest algorithm" - } + pub fn from_ssl_error(url: &ServoUrl, error: &Error) -> Self { + NetworkError::SslValidation(url.clone(), error.description().to_owned()) } } diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 699574f30da..cb4418b94df 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -34,7 +34,7 @@ bluetooth_traits = {path = "../bluetooth_traits"} byteorder = "1.0" canvas_traits = {path = "../canvas_traits"} caseless = "0.1.0" -cookie = "0.2.5" +cookie = "0.6" cssparser = "0.12" deny_public_fields = {path = "../deny_public_fields"} devtools_traits = {path = "../devtools_traits"} @@ -48,8 +48,8 @@ heapsize = "0.3.6" heapsize_derive = "0.1" html5ever = {version = "0.14", features = ["heap_size", "unstable"]} html5ever-atoms = {version = "0.2", features = ["heap_size"]} -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper_serde = "0.6" image = "0.12" ipc-channel = "0.7" js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]} diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 7a50fe5cf6c..fe1065104f4 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use cookie_rs; use core::nonzero::NonZero; use devtools_traits::ScriptToDevtoolsControlMsg; use document_loader::{DocumentLoader, LoadType}; @@ -3285,15 +3286,15 @@ impl DocumentMethods for Document { return Err(Error::Security); } - let header = Header::parse_header(&[cookie.into()]); - if let Ok(SetCookie(cookies)) = header { - let cookies = cookies.into_iter().map(Serde).collect(); + if let Ok(cookie_header) = SetCookie::parse_header(&vec![cookie.to_string().into_bytes()]) { + let cookies = cookie_header.0.into_iter().filter_map(|cookie| { + cookie_rs::Cookie::parse(cookie).ok().map(Serde) + }).collect(); let _ = self.window - .upcast::() - .resource_threads() - .send(SetCookiesForUrl(self.url(), cookies, NonHTTP)); + .upcast::() + .resource_threads() + .send(SetCookiesForUrl(self.url(), cookies, NonHTTP)); } - Ok(()) } diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 6618bac4241..7e7fe95122b 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -182,9 +182,9 @@ pub fn handle_get_active_element(documents: &Documents, pub fn handle_get_cookies(documents: &Documents, pipeline: PipelineId, - reply: IpcSender>>) { + reply: IpcSender>>>) { // TODO: Return an error if the pipeline doesn't exist? - let cookies: Vec> = match documents.find_document(pipeline) { + let cookies = match documents.find_document(pipeline) { None => Vec::new(), Some(document) => { let url = document.url(); @@ -202,9 +202,9 @@ pub fn handle_get_cookies(documents: &Documents, pub fn handle_get_cookie(documents: &Documents, pipeline: PipelineId, name: String, - reply: IpcSender>>) { + reply: IpcSender>>>) { // TODO: Return an error if the pipeline doesn't exist? - let cookies: Vec> = match documents.find_document(pipeline) { + let cookies = match documents.find_document(pipeline) { None => Vec::new(), Some(document) => { let url = document.url(); @@ -215,13 +215,13 @@ pub fn handle_get_cookie(documents: &Documents, receiver.recv().unwrap() }, }; - reply.send(cookies.into_iter().filter(|c| c.name == &*name).collect()).unwrap(); + reply.send(cookies.into_iter().filter(|c| c.name() == &*name).collect()).unwrap(); } // https://w3c.github.io/webdriver/webdriver-spec.html#add-cookie pub fn handle_add_cookie(documents: &Documents, pipeline: PipelineId, - cookie: Cookie, + cookie: Cookie<'static>, reply: IpcSender>) { // TODO: Return a different error if the pipeline doesn't exist? let document = match documents.find_document(pipeline) { @@ -229,22 +229,24 @@ pub fn handle_add_cookie(documents: &Documents, None => return reply.send(Err(WebDriverCookieError::UnableToSetCookie)).unwrap(), }; let url = document.url(); - let method = if cookie.httponly { + let method = if cookie.http_only() { HTTP } else { NonHTTP }; - reply.send(match (document.is_cookie_averse(), cookie.domain.clone()) { + + let domain = cookie.domain().map(ToOwned::to_owned); + reply.send(match (document.is_cookie_averse(), domain) { (true, _) => Err(WebDriverCookieError::InvalidDomain), - (false, Some(ref domain)) if url.host_str().map(|x| { x == &**domain }).unwrap_or(false) => { + (false, Some(ref domain)) if url.host_str().map(|x| { x == domain }).unwrap_or(false) => { let _ = document.window().upcast::().resource_threads().send( - SetCookieForUrl(url, cookie, method) + SetCookieForUrl(url, Serde(cookie), method) ); Ok(()) }, (false, None) => { let _ = document.window().upcast::().resource_threads().send( - SetCookieForUrl(url, cookie, method) + SetCookieForUrl(url, Serde(cookie), method) ); Ok(()) }, diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml index 60c8e82a5cb..53a57c28c27 100644 --- a/components/script_traits/Cargo.toml +++ b/components/script_traits/Cargo.toml @@ -13,14 +13,14 @@ path = "lib.rs" app_units = "0.4" bluetooth_traits = {path = "../bluetooth_traits"} canvas_traits = {path = "../canvas_traits"} -cookie = "0.2.5" +cookie = "0.6" devtools_traits = {path = "../devtools_traits"} euclid = "0.11" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" heapsize_derive = "0.1" -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper_serde = "0.6" ipc-channel = "0.7" libc = "0.2" msg = {path = "../msg"} diff --git a/components/script_traits/webdriver_msg.rs b/components/script_traits/webdriver_msg.rs index 9fe9e9b80f5..c09f1f19dae 100644 --- a/components/script_traits/webdriver_msg.rs +++ b/components/script_traits/webdriver_msg.rs @@ -16,7 +16,7 @@ use servo_url::ServoUrl; pub enum WebDriverScriptCommand { AddCookie(#[serde(deserialize_with = "::hyper_serde::deserialize", serialize_with = "::hyper_serde::serialize")] - Cookie, + Cookie<'static>, IpcSender>), ExecuteScript(String, IpcSender), ExecuteAsyncScript(String, IpcSender), @@ -24,8 +24,8 @@ pub enum WebDriverScriptCommand { FindElementsCSS(String, IpcSender, ()>>), FocusElement(String, IpcSender>), GetActiveElement(IpcSender>), - GetCookie(String, IpcSender>>), - GetCookies(IpcSender>>), + GetCookie(String, IpcSender>>>), + GetCookies(IpcSender>>>), GetElementAttribute(String, String, IpcSender, ()>>), GetElementCSS(String, String, IpcSender>), GetElementRect(String, IpcSender, ()>>), diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml index 08f21a60b5d..b6a6019f7e5 100644 --- a/components/webdriver_server/Cargo.toml +++ b/components/webdriver_server/Cargo.toml @@ -11,9 +11,9 @@ path = "lib.rs" [dependencies] base64 = "0.4.1" -cookie = "0.2.5" +cookie = "0.6" euclid = "0.11" -hyper = "0.9.9" +hyper = "0.10" image = "0.12" ipc-channel = "0.7" log = "0.3.5" @@ -26,4 +26,4 @@ servo_config = {path = "../config", features = ["servo"]} servo_url = {path = "../url", features = ["servo"]} url = {version = "1.2", features = ["heap_size"]} uuid = {version = "0.4", features = ["v4"]} -webdriver = "0.20" +webdriver = "0.22" diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index d0aa102e2e9..6fb494e0eef 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -69,16 +69,22 @@ fn extension_routes() -> Vec<(Method, &'static str, ServoExtensionRoute)> { fn cookie_msg_to_cookie(cookie: cookie_rs::Cookie) -> Cookie { Cookie { - name: cookie.name, - value: cookie.value, - path: cookie.path.map(Nullable::Value).unwrap_or(Nullable::Null), - domain: cookie.domain.map(Nullable::Value).unwrap_or(Nullable::Null), - expiry: match cookie.expires { + name: cookie.name().to_owned(), + value: cookie.value().to_owned(), + path: match cookie.path() { + Some(path) => Nullable::Value(path.to_string()), + None => Nullable::Null + }, + domain: match cookie.domain() { + Some(domain) => Nullable::Value(domain.to_string()), + None => Nullable::Null + }, + expiry: match cookie.expires() { Some(time) => Nullable::Value(Date::new(time.to_timespec().sec as u64)), None => Nullable::Null }, - secure: cookie.secure, - httpOnly: cookie.httponly, + secure: cookie.secure(), + httpOnly: cookie.http_only(), } } @@ -100,14 +106,14 @@ struct WebDriverSession { /// Time to wait for injected scripts to run before interrupting them. A [`None`] value /// specifies that the script should run indefinitely. - script_timeout: Option, + script_timeout: Option, /// Time to wait for a page to finish loading upon navigation. - load_timeout: u32, + load_timeout: Option, /// Time to wait for the element location strategy when retrieving elements, and when /// waiting for an element to become interactable. - implicit_wait_timeout: u32, + implicit_wait_timeout: Option, } impl WebDriverSession { @@ -117,8 +123,8 @@ impl WebDriverSession { frame_id: None, script_timeout: Some(30_000), - load_timeout: 300_000, - implicit_wait_timeout: 0, + load_timeout: Some(300_000), + implicit_wait_timeout: Some(0), } } } @@ -369,7 +375,7 @@ impl Handler { let timeout = session.load_timeout; let timeout_chan = sender; thread::spawn(move || { - thread::sleep(Duration::from_millis(timeout as u64)); + thread::sleep(Duration::from_millis(timeout.unwrap())); let _ = timeout_chan.send(LoadStatus::LoadTimeout); }); @@ -671,17 +677,19 @@ impl Handler { fn handle_add_cookie(&self, params: &AddCookieParameters) -> WebDriverResult { let (sender, receiver) = ipc::channel().unwrap(); - let cookie = cookie_rs::Cookie { - name: params.name.to_owned(), - value: params.value.to_owned(), - path: params.path.to_owned().into(), - domain: params.domain.to_owned().into(), - expires: None, - max_age: None, - secure: params.secure, - httponly: params.httpOnly, - custom: BTreeMap::new() + + let cookie = cookie_rs::Cookie::build(params.name.to_owned(), params.value.to_owned()) + .secure(params.secure) + .http_only(params.httpOnly); + let cookie = match params.domain { + Nullable::Value(ref domain) => cookie.domain(domain.to_owned()), + _ => cookie, }; + let cookie = match params.path { + Nullable::Value(ref path) => cookie.path(path.to_owned()).finish(), + _ => cookie.finish(), + }; + try!(self.frame_script_command(WebDriverScriptCommand::AddCookie(cookie, sender))); match receiver.recv().unwrap() { Ok(_) => Ok(WebDriverResponse::Void), @@ -701,17 +709,10 @@ impl Handler { .as_mut() .ok_or(WebDriverError::new(ErrorStatus::SessionNotCreated, ""))); - // TODO: this conversion is crazy, spec should limit these to u32 and check upstream - let value = parameters.ms as u32; - match ¶meters.type_[..] { - "script" => session.script_timeout = Some(value), - "page load" => session.load_timeout = value, - "implicit" => session.implicit_wait_timeout = value, - x => { - return Err(WebDriverError::new(ErrorStatus::InvalidSelector, - format!("Unknown timeout type {}", x))) - } - } + session.script_timeout = parameters.script; + session.load_timeout = parameters.page_load; + session.implicit_wait_timeout = parameters.implicit; + Ok(WebDriverResponse::Void) } diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py index f65cd7208e5..72867fcf155 100644 --- a/python/servo/bootstrap.py +++ b/python/servo/bootstrap.py @@ -196,7 +196,7 @@ def windows_msvc(context, force=False): '''Bootstrapper for MSVC building on Windows.''' deps_dir = os.path.join(context.sharedir, "msvc-dependencies") - deps_url = "https://servo-rust.s3.amazonaws.com/msvc-deps/" + deps_url = "https://servo-deps.s3.amazonaws.com/msvc-deps/" def version(package): return packages.WINDOWS_MSVC[package] diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 5fbb7ba164d..a8cb0f9e4a9 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -321,7 +321,7 @@ class MachCommands(CommandBase): call(["editbin", "/nologo", "/subsystem:windows", path.join(servo_exe_dir, "servo.exe")], verbose=verbose) # on msvc, we need to copy in some DLLs in to the servo.exe dir - for ssl_lib in ["ssleay32md.dll", "libeay32md.dll"]: + for ssl_lib in ["libcryptoMD.dll", "libsslMD.dll"]: shutil.copy(path.join(env['OPENSSL_LIB_DIR'], "../bin" + msvc_x64, ssl_lib), servo_exe_dir) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 4ee5819ee57..8db1209a6e4 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -407,7 +407,7 @@ class CommandBase(object): # Link openssl env["OPENSSL_INCLUDE_DIR"] = path.join(package_dir("openssl"), "include") env["OPENSSL_LIB_DIR"] = path.join(package_dir("openssl"), "lib" + msvc_x64) - env["OPENSSL_LIBS"] = "ssleay32MD:libeay32MD" + env["OPENSSL_LIBS"] = "libsslMD:libcryptoMD" # Link moztools env["MOZTOOLS_PATH"] = path.join(package_dir("moztools"), "bin") diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index d8c2fbe4924..16c942efe7c 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -108,7 +108,7 @@ def copy_dependencies(binary_path, lib_path): def copy_windows_dependencies(binary_path, destination): try: - [shutil.copy(path.join(binary_path, d), destination) for d in ["libeay32md.dll", "ssleay32md.dll"]] + [shutil.copy(path.join(binary_path, d), destination) for d in ["libcryptoMD.dll", "libsslMD.dll"]] except: deps = [ "libstdc++-6.dll", @@ -119,8 +119,8 @@ def copy_windows_dependencies(binary_path, destination): "zlib1.dll", "libiconv-2.dll", "libintl-8.dll", - "libeay32.dll", - "ssleay32.dll", + "libcryptoMD.dll", + "libsslMD.dll", ] for d in deps: dep_path = path.join("C:\\msys64\\mingw64\\bin", d) diff --git a/python/servo/packages.py b/python/servo/packages.py index e8054f9a502..1413e1c645a 100644 --- a/python/servo/packages.py +++ b/python/servo/packages.py @@ -21,5 +21,5 @@ WINDOWS_MSVC = { "cmake": "3.6.1", "moztools": "0.0.1-5", "ninja": "1.7.1", - "openssl": "1.0.1t-vs2015", + "openssl": "1.1.0e-vs2015", } diff --git a/tests/unit/net/Cargo.toml b/tests/unit/net/Cargo.toml index bfe13cd887a..39b2ed521c6 100644 --- a/tests/unit/net/Cargo.toml +++ b/tests/unit/net/Cargo.toml @@ -10,11 +10,12 @@ path = "lib.rs" doctest = false [dependencies] -cookie = "0.2" +cookie = "0.6" devtools_traits = {path = "../../../components/devtools_traits"} flate2 = "0.2.0" -hyper = "0.9.9" -hyper_serde = "0.5" +hyper = "0.10" +hyper-openssl = "0.2" +hyper_serde = "0.6" ipc-channel = "0.7" msg = {path = "../../../components/msg"} net = {path = "../../../components/net"} diff --git a/tests/unit/net/cookie.rs b/tests/unit/net/cookie.rs index fbeebab2c5f..44b80a1a21e 100644 --- a/tests/unit/net/cookie.rs +++ b/tests/unit/net/cookie.rs @@ -69,7 +69,7 @@ fn fn_cookie_constructor() { let cookie = cookie_rs::Cookie::parse(" baz = bar; Domain = ").unwrap(); assert!(Cookie::new_wrapped(cookie.clone(), url, CookieSource::HTTP).is_some()); let cookie = Cookie::new_wrapped(cookie, url, CookieSource::HTTP).unwrap(); - assert!(&**cookie.cookie.domain.as_ref().unwrap() == "example.com"); + assert!(&**cookie.cookie.domain().as_ref().unwrap() == "example.com"); // cookie public domains test let cookie = cookie_rs::Cookie::parse(" baz = bar; Domain = gov.ac").unwrap(); @@ -88,11 +88,11 @@ fn fn_cookie_constructor() { let cookie = cookie_rs::Cookie::parse(" baz = bar ; Secure; Path = /foo/bar/").unwrap(); let cookie = Cookie::new_wrapped(cookie, url, CookieSource::HTTP).unwrap(); - assert!(cookie.cookie.value == "bar"); - assert!(cookie.cookie.name == "baz"); - assert!(cookie.cookie.secure); - assert!(&cookie.cookie.path.as_ref().unwrap()[..] == "/foo/bar/"); - assert!(&cookie.cookie.domain.as_ref().unwrap()[..] == "example.com"); + assert!(cookie.cookie.value() == "bar"); + assert!(cookie.cookie.name() == "baz"); + assert!(cookie.cookie.secure()); + assert!(&cookie.cookie.path().as_ref().unwrap()[..] == "/foo/bar/"); + assert!(&cookie.cookie.domain().as_ref().unwrap()[..] == "example.com"); assert!(cookie.host_only); let u = &ServoUrl::parse("http://example.com/foobar").unwrap(); @@ -125,7 +125,7 @@ fn test_sort_order() { let b = cookie_rs::Cookie::parse("baz=bar;Path=/foo/bar/baz/").unwrap(); let b = Cookie::new_wrapped(b, url, CookieSource::HTTP).unwrap(); - assert!(b.cookie.path.as_ref().unwrap().len() > a.cookie.path.as_ref().unwrap().len()); + assert!(b.cookie.path().as_ref().unwrap().len() > a.cookie.path().as_ref().unwrap().len()); assert!(CookieStorage::cookie_comparator(&a, &b) == Ordering::Greater); assert!(CookieStorage::cookie_comparator(&b, &a) == Ordering::Less); assert!(CookieStorage::cookie_comparator(&a, &a_prime) == Ordering::Less); @@ -136,7 +136,8 @@ fn test_sort_order() { fn add_cookie_to_storage(storage: &mut CookieStorage, url: &ServoUrl, cookie_str: &str) { let source = CookieSource::HTTP; - let cookie = Cookie::new_wrapped(cookie_rs::Cookie::parse(cookie_str).unwrap(), url, source).unwrap(); + let cookie = cookie_rs::Cookie::parse(cookie_str.to_owned()).unwrap(); + let cookie = Cookie::new_wrapped(cookie, url, source).unwrap(); storage.push(cookie, url, source); } @@ -261,7 +262,7 @@ fn add_retrieve_cookies(set_location: &str, let header = Header::parse_header(&[bytes]).unwrap(); let SetCookie(cookies) = header; for bare_cookie in cookies { - let cookie = Cookie::new_wrapped(bare_cookie, &url, source).unwrap(); + let cookie = Cookie::from_cookie_string(bare_cookie, &url, source).unwrap(); storage.push(cookie, &url, source); } } diff --git a/tests/unit/net/cookie_http_state.rs b/tests/unit/net/cookie_http_state.rs index 7d5df8b658c..30cec8b26b2 100644 --- a/tests/unit/net/cookie_http_state.rs +++ b/tests/unit/net/cookie_http_state.rs @@ -20,7 +20,7 @@ fn run(set_location: &str, set_cookies: &[&str], final_location: &str) -> String let header = Header::parse_header(&[bytes]); if let Ok(SetCookie(cookies)) = header { for bare_cookie in cookies { - if let Some(cookie) = Cookie::new_wrapped(bare_cookie, &url, source) { + if let Some(cookie) = Cookie::from_cookie_string(bare_cookie, &url, source) { storage.push(cookie, &url, source); } } diff --git a/tests/unit/net/fetch.rs b/tests/unit/net/fetch.rs index 066b30bbd63..f7342a576eb 100644 --- a/tests/unit/net/fetch.rs +++ b/tests/unit/net/fetch.rs @@ -18,10 +18,10 @@ use hyper::header::{Encoding, Location, Pragma, Quality, QualityItem, SetCookie, use hyper::header::{Headers, Host, HttpDate, Referer as HyperReferer}; use hyper::method::Method; use hyper::mime::{Mime, SubLevel, TopLevel}; -use hyper::net::Openssl; use hyper::server::{Request as HyperRequest, Response as HyperResponse, Server}; use hyper::status::StatusCode; use hyper::uri::RequestUri; +use hyper_openssl; use msg::constellation_msg::TEST_PIPELINE_ID; use net::fetch::cors_cache::CorsCache; use net::fetch::methods::FetchContext; @@ -524,9 +524,10 @@ fn test_fetch_with_hsts() { let mut key_path = path.clone(); key_path.push("privatekey_for_testing.key"); - let ssl = Openssl::with_cert_and_key(cert_path.into_os_string(), key_path.into_os_string()) + let ssl = hyper_openssl::OpensslServer::from_files(key_path, cert_path) .unwrap(); + //takes an address and something that implements hyper::net::Ssl let mut server = Server::https("0.0.0.0:0", ssl).unwrap().handle_threads(handler, 1).unwrap(); let context = FetchContext { diff --git a/tests/unit/net/http_loader.rs b/tests/unit/net/http_loader.rs index 4aade01d73c..4a41b3c112f 100644 --- a/tests/unit/net/http_loader.rs +++ b/tests/unit/net/http_loader.rs @@ -511,7 +511,7 @@ fn test_load_doesnt_add_host_to_sts_list_when_url_is_http_even_if_sts_headers_ar #[test] fn test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_in_response() { let handler = move |_: HyperRequest, mut response: HyperResponse| { - response.headers_mut().set(SetCookie(vec![CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned())])); + response.headers_mut().set(SetCookie(vec!["mozillaIs=theBest".to_owned()])); response.send(b"Yay!").unwrap(); }; let (mut server, url) = make_server(handler); @@ -543,7 +543,7 @@ fn test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_ fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_resource_manager() { let handler = move |request: HyperRequest, response: HyperResponse| { assert_eq!(request.headers.get::(), - Some(&CookieHeader(vec![CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned())]))); + Some(&CookieHeader(vec!["mozillaIs=theBest".to_owned()]))); response.send(b"Yay!").unwrap(); }; let (mut server, url) = make_server(handler); @@ -581,7 +581,7 @@ fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_re fn test_load_sends_cookie_if_nonhttp() { let handler = move |request: HyperRequest, response: HyperResponse| { assert_eq!(request.headers.get::(), - Some(&CookieHeader(vec![CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned())]))); + Some(&CookieHeader(vec!["mozillaIs=theBest".to_owned()]))); response.send(b"Yay!").unwrap(); }; let (mut server, url) = make_server(handler); @@ -618,9 +618,8 @@ fn test_load_sends_cookie_if_nonhttp() { #[test] fn test_cookie_set_with_httponly_should_not_be_available_using_getcookiesforurl() { let handler = move |_: HyperRequest, mut response: HyperResponse| { - let mut pair = CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned()); - pair.httponly = true; - response.headers_mut().set(SetCookie(vec![pair])); + let pair = vec!["mozillaIs=theBest; HttpOnly".to_owned()]; + response.headers_mut().set(SetCookie(pair)); response.send(b"Yay!").unwrap(); }; let (mut server, url) = make_server(handler); @@ -653,9 +652,8 @@ fn test_cookie_set_with_httponly_should_not_be_available_using_getcookiesforurl( #[test] fn test_when_cookie_received_marked_secure_is_ignored_for_http() { let handler = move |_: HyperRequest, mut response: HyperResponse| { - let mut pair = CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned()); - pair.secure = true; - response.headers_mut().set(SetCookie(vec![pair])); + let pair = vec!["mozillaIs=theBest; Secure".to_owned()]; + response.headers_mut().set(SetCookie(pair)); response.send(b"Yay!").unwrap(); }; let (mut server, url) = make_server(handler); @@ -951,14 +949,14 @@ fn test_redirect_from_x_to_y_provides_y_cookies_from_y() { }; if path == "/com/" { assert_eq!(request.headers.get(), - Some(&CookieHeader(vec![CookiePair::new("mozillaIsNot".to_owned(), "dotOrg".to_owned())]))); + Some(&CookieHeader(vec!["mozillaIsNot=dotOrg".to_owned()]))); let location = shared_url_y.lock().unwrap().as_ref().unwrap().to_string(); response.headers_mut().set(Location(location)); *response.status_mut() = StatusCode::MovedPermanently; response.send(b"").unwrap(); } else if path == "/org/" { assert_eq!(request.headers.get(), - Some(&CookieHeader(vec![CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned())]))); + Some(&CookieHeader(vec!["mozillaIs=theBest".to_owned()]))); response.send(b"Yay!").unwrap(); } else { panic!("unexpected path {:?}", path) @@ -1032,7 +1030,7 @@ fn test_redirect_from_x_to_x_provides_x_with_cookie_from_first_response() { response.send(b"").unwrap(); } else if path == "/subsequent/" { assert_eq!(request.headers.get(), - Some(&CookieHeader(vec![CookiePair::new("mozillaIs".to_owned(), "theBest".to_owned())]))); + Some(&CookieHeader(vec!["mozillaIs=theBest".to_owned()]))); response.send(b"Yay!").unwrap(); } else { panic!("unexpected path {:?}", path) diff --git a/tests/unit/net/lib.rs b/tests/unit/net/lib.rs index 3c96f7f91cb..a6047517dda 100644 --- a/tests/unit/net/lib.rs +++ b/tests/unit/net/lib.rs @@ -6,6 +6,7 @@ extern crate cookie as cookie_rs; extern crate devtools_traits; extern crate flate2; extern crate hyper; +extern crate hyper_openssl; extern crate hyper_serde; extern crate ipc_channel; extern crate msg;