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

Unified Diff: tests/standalone/io/secure_unauthorized_test.dart

Issue 1616073004: Adds SecurityContext.usePrivateKeyBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/secure_unauthorized_test.dart
diff --git a/tests/standalone/io/secure_unauthorized_test.dart b/tests/standalone/io/secure_unauthorized_test.dart
index a600d7458f3ab0b1f444217dbc365a4fb1b77972..3f5924903161522f07b1d952bad490374ad0f411 100644
--- a/tests/standalone/io/secure_unauthorized_test.dart
+++ b/tests/standalone/io/secure_unauthorized_test.dart
@@ -12,11 +12,12 @@ import "dart:io";
const HOST_NAME = "localhost";
String localFile(path) => Platform.script.resolve(path).toFilePath();
+List<int> readLocalFile(path) => (new File(localFile(path))).readAsBytesSync();
SecurityContext serverContext = new SecurityContext()
..useCertificateChain(localFile('certificates/untrusted_server_chain.pem'))
- ..usePrivateKey(localFile('certificates/untrusted_server_key.pem'),
- password: 'dartdart');
+ ..usePrivateKeyBytes(readLocalFile('certificates/untrusted_server_key.pem'),
+ password: 'dartdart');
Future<SecureServerSocket> runServer() {
return SecureServerSocket.bind(HOST_NAME, 0, serverContext)

Powered by Google App Engine
This is Rietveld 408576698