Fixes a rare segfault in creating the test cert