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