Index: tests/standalone/io/security_context_argument_test.dart |
diff --git a/tests/standalone/io/security_context_argument_test.dart b/tests/standalone/io/security_context_argument_test.dart |
index 60577b245751a89ed33953db6afaf957cdd86a22..391708a933c652ec72718e5eb262f868fa63bed4 100644 |
--- a/tests/standalone/io/security_context_argument_test.dart |
+++ b/tests/standalone/io/security_context_argument_test.dart |
@@ -34,6 +34,25 @@ void testUsePrivateKeyArguments() { |
Expect.throws(() => c.usePrivateKeySync( |
localFile('certificates/server_key.pem'), password: 3), |
argumentOrTypeError); |
+ |
+ // Malformed PEM certs. |
+ Expect.throws(() => c.usePrivateKeySync( |
+ localFile('certificates/client1_key_malformed.pem'), |
+ password: "dartdart"), |
+ tlsException); |
+ Expect.throws(() => c.setTrustedCertificatesSync( |
+ localFile('certificates/trusted_certs_malformed.pem')), |
+ tlsException); |
+ Expect.throws(() => c.useCertificateChainSync( |
+ localFile('certificates/server_chain_malformed1.pem')), |
+ tlsException); |
+ Expect.throws(() => c.useCertificateChainSync( |
+ localFile('certificates/server_chain_malformed2.pem')), |
+ tlsException); |
+ Expect.throws(() => c.setClientAuthoritiesSync( |
+ localFile('certificates/client_authority_malformed.pem')), |
+ argumentError); |
+ |
c.usePrivateKeySync( |
localFile('certificates/server_key.pem'), password: "dartdart"); |
} |