aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-12-14 15:23:46 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-12-14 15:23:46 -0800
commit172895c2a9444ce356d408a2fc5091a965a921c2 (patch)
treed76826b146b8bc4ce7c622cc78d6052428d4ce43 /test
parent7d408487fa1127dd868bdedd0baebc671ebed1cc (diff)
Add documentation
Diffstat (limited to 'test')
-rw-r--r--test/core/bad_ssl/server.c5
-rw-r--r--test/core/bad_ssl/servers/alpn.c5
-rw-r--r--test/core/bad_ssl/servers/cert.c3
3 files changed, 13 insertions, 0 deletions
diff --git a/test/core/bad_ssl/server.c b/test/core/bad_ssl/server.c
index c2ad337306..43312f1577 100644
--- a/test/core/bad_ssl/server.c
+++ b/test/core/bad_ssl/server.c
@@ -38,6 +38,11 @@
#include "test/core/bad_ssl/server.h"
#include "test/core/util/test_config.h"
+/* Common server implementation details for all servers in servers/.
+ * There's nothing *wrong* with these servers per-se, but they are
+ * configured to cause some failure case in the SSL connection path.
+ */
+
static int got_sigint = 0;
static void sigint_handler(int x) { got_sigint = 1; }
diff --git a/test/core/bad_ssl/servers/alpn.c b/test/core/bad_ssl/servers/alpn.c
index a4e117db73..7d70690e52 100644
--- a/test/core/bad_ssl/servers/alpn.c
+++ b/test/core/bad_ssl/servers/alpn.c
@@ -38,9 +38,14 @@
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
+#include "src/core/transport/chttp2/alpn.h"
#include "test/core/bad_ssl/server.h"
#include "test/core/end2end/data/ssl_test_data.h"
+/* This test starts a server that is configured to advertise (via alpn and npn)
+ * a protocol that the connecting client does not support. It does this by
+ * overriding the functions declared in alpn.c from the core library. */
+
static const char *const fake_versions[] = {"not-h2"};
int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) {
diff --git a/test/core/bad_ssl/servers/cert.c b/test/core/bad_ssl/servers/cert.c
index 8a294c8fe3..d67a6ca1d4 100644
--- a/test/core/bad_ssl/servers/cert.c
+++ b/test/core/bad_ssl/servers/cert.c
@@ -43,6 +43,9 @@
#include "test/core/bad_ssl/server.h"
#include "test/core/end2end/data/ssl_test_data.h"
+/* This server will present an untrusted cert to the connecting client,
+ * causing the SSL handshake to fail */
+
int main(int argc, char **argv) {
const char *addr = bad_ssl_addr(argc, argv);
grpc_ssl_pem_key_cert_pair pem_key_cert_pair;