Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: tests/standalone/io/secure_session_resume_test.dart

Issue 11478049: Disable SSL session cache to fix issue with SecureSocket connections. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/secure_socket.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This test tests TLS session resume, by making multiple client connections
6 // on the same port to the same server, with a delay of 200 ms between them.
7 // The unmodified secure_server_test creates all sessions simultaneously,
8 // which means that no handshake completes and caches its keys in the session
9 // cache in time for other connections to use it.
10 //
11 // Session resume is currently disabled - see issue
12 // https://code.google.com/p/dart/issues/detail?id=7230
13
5 import "dart:io"; 14 import "dart:io";
6 import "dart:isolate"; 15 import "dart:isolate";
7 16
8 const SERVER_ADDRESS = "127.0.0.1"; 17 const SERVER_ADDRESS = "127.0.0.1";
9 const HOST_NAME = "localhost"; 18 const HOST_NAME = "localhost";
10 19
11 void WriteAndClose(Socket socket, String message) { 20 void WriteAndClose(Socket socket, String message) {
12 var data = message.charCodes; 21 var data = message.charCodes;
13 int written = 0; 22 int written = 0;
14 void write() { 23 void write() {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 103
95 Function EndTest; 104 Function EndTest;
96 105
97 const CLIENT_NAMES = const ['able', 'baker', 'camera', 'donut', 'echo']; 106 const CLIENT_NAMES = const ['able', 'baker', 'camera', 'donut', 'echo'];
98 107
99 void main() { 108 void main() {
100 ReceivePort keepAlive = new ReceivePort(); 109 ReceivePort keepAlive = new ReceivePort();
101 Path scriptDir = new Path.fromNative(new Options().script).directoryPath; 110 Path scriptDir = new Path.fromNative(new Options().script).directoryPath;
102 Path certificateDatabase = scriptDir.append('pkcert'); 111 Path certificateDatabase = scriptDir.append('pkcert');
103 SecureSocket.initialize(database: certificateDatabase.toNativePath(), 112 SecureSocket.initialize(database: certificateDatabase.toNativePath(),
104 password: 'dartdart'); 113 password: 'dartdart',
114 useBuiltinRoots: false);
105 115
106 var server = new SecureTestServer(); 116 var server = new SecureTestServer();
107 int port = server.start(); 117 int port = server.start();
108 118
109 EndTest = () { 119 EndTest = () {
110 Expect.equals(CLIENT_NAMES.length, server.numConnections); 120 Expect.equals(CLIENT_NAMES.length, server.numConnections);
111 server.stop(); 121 server.stop();
112 keepAlive.close(); 122 keepAlive.close();
113 }; 123 };
114 124
125 int delay = 0;
126 int delay_between_connections = 200; // Milliseconds.
Mads Ager (google) 2012/12/10 11:28:50 Does this fail with a smaller timeout as well? Can
Bill Hesse 2012/12/10 13:13:20 The timeout needs to be at least 200 ms, and more
127
115 for (var x in CLIENT_NAMES) { 128 for (var x in CLIENT_NAMES) {
116 new SecureTestClient(port, x); 129 new Timer(delay, (_) {
130 new SecureTestClient(port, x);
131 });
132 delay += delay_between_connections;
117 } 133 }
118 } 134 }
OLDNEW
« no previous file with comments | « runtime/bin/secure_socket.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698