| 64 | struct GlobalFixtureSSL |
| 65 | { |
| 66 | GlobalFixtureSSL() |
| 67 | { |
| 68 | using namespace boost::unit_test::framework; |
| 69 | for (int i = 0; i < master_test_suite().argc; ++i) |
| 70 | { |
| 71 | BOOST_TEST_MESSAGE(boost::format("argv[%1%] = \"%2%\"") % i % master_test_suite().argv[i]); |
| 72 | } |
| 73 | |
| 74 | #ifdef __linux__ |
| 75 | // OpenSSL calls send() without MSG_NOSIGPIPE so writing to a socket that has |
| 76 | // disconnected can cause a SIGPIPE signal... |
| 77 | signal(SIGPIPE, SIG_IGN); |
| 78 | #endif |
| 79 | |
| 80 | TSSLSocketFactory::setManualOpenSSLInitialization(true); |
| 81 | apache::thrift::transport::initializeOpenSSL(); |
| 82 | |
| 83 | keyDir = boost::filesystem::current_path().parent_path().parent_path().parent_path() / "test" / "keys"; |
| 84 | if (!boost::filesystem::exists(certFile("server.crt"))) |
| 85 | { |
| 86 | keyDir = boost::filesystem::path(master_test_suite().argv[master_test_suite().argc - 1]); |
| 87 | if (!boost::filesystem::exists(certFile("server.crt"))) |
| 88 | { |
| 89 | throw std::invalid_argument("The last argument to this test must be the directory containing the test certificate(s)."); |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | virtual ~GlobalFixtureSSL() |
| 95 | { |
nothing calls this directly
no test coverage detected