@@ -196,7 +196,7 @@ TEST_F(ConnectionUnitTest, Ssl) {
196196TEST_F (ConnectionUnitTest, SslDefaultVerifyPaths) {
197197 const String host = " 127.0.0.1" ;
198198 const int verification_flags = CASS_SSL_VERIFY_PEER_CERT | CASS_SSL_VERIFY_PEER_IDENTITY;
199- const char * cert_path = " cassandra-unit-test.cert " ;
199+ const String cert_path = std::tmpnam ( nullptr ) ;
200200
201201 mockssandra::SimpleCluster cluster (simple ());
202202 const String cert = cluster.use_ssl (host);
@@ -217,13 +217,14 @@ TEST_F(ConnectionUnitTest, SslDefaultVerifyPaths) {
217217 << " Verification succeeded without certificate." ;
218218
219219 // Generate certificate as file (which is used by our mock cluster) and import it
220- std::ofstream cert_buffer (cert_path);
220+ std::ofstream cert_buffer (cert_path. c_str () );
221221 cert_buffer << cert;
222222 cert_buffer.close ();
223- ASSERT_EQ (uv_os_setenv (" SSL_CERT_FILE" , cert_path), 0 ) << " Failed to prepare openssl environment" ;
223+ ASSERT_EQ (uv_os_setenv (" SSL_CERT_FILE" , cert_path.c_str ()), 0 )
224+ << " Failed to prepare openssl environment" ;
224225 ASSERT_EQ (settings.socket_settings .ssl_context ->set_default_verify_paths (), CASS_OK)
225226 << " Failed to import default / system SSL certificates." ;
226- ASSERT_EQ (std::remove (cert_path), 0 ) << " Failed to cleanup temporary certificate file." ;
227+ ASSERT_EQ (std::remove (cert_path. c_str () ), 0 ) << " Failed to cleanup temporary certificate file." ;
227228
228229 // Ensure verification succeeds with this certificate.
229230 State state;
0 commit comments