diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c
index a78a0798aead7432faa01e753251bf91ae3c8e0f..c6ff5d31e8837a508e4cc1c5ac40f5a19a2f337f 100644
--- a/test/core/bad_ssl/bad_ssl_test.c
+++ b/test/core/bad_ssl/bad_ssl_test.c
@@ -41,6 +41,7 @@
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/subprocess.h>
+#include "src/core/support/env.h"
 #include "src/core/support/string.h"
 #include "test/core/util/port.h"
 #include "test/core/end2end/cq_verifier.h"
@@ -144,6 +145,9 @@ int main(int argc, char **argv) {
   } else {
     strcpy(root, ".");
   }
+  if (argc == 2) {
+    gpr_setenv("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", argv[1]);
+  }
   /* figure out our test name */
   tmp = lunder - 1;
   while (*tmp != '_') tmp--;