THRIFT-2325 SSL-test-certificates_cpp_tests
Patch: Roger Meier
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index acb0518..591d19d 100755
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -162,7 +162,7 @@
if (ssl) {
factory = boost::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
factory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
- factory->loadTrustedCertificates("./trusted-ca-certificate.pem");
+ factory->loadTrustedCertificates("keys/CA.pem");
factory->authenticate(true);
socket = factory->createSocket(host, port);
} else {
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 8cf8db1..ad7df07 100755
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -598,19 +598,18 @@
if (ssl) {
sslSocketFactory = boost::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
- sslSocketFactory->loadCertificate("./server-certificate.pem");
- sslSocketFactory->loadPrivateKey("./server-private-key.pem");
+ sslSocketFactory->loadCertificate("keys/server.crt");
+ sslSocketFactory->loadPrivateKey("keys/server.key");
sslSocketFactory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
serverSocket = boost::shared_ptr<TServerSocket>(new TSSLServerSocket(port, sslSocketFactory));
} else {
- if (domain_socket != "") {
- unlink(domain_socket.c_str());
- serverSocket = boost::shared_ptr<TServerSocket>(new TServerSocket(domain_socket));
- port = 0;
- }
- else {
+ if (domain_socket != "") {
+ unlink(domain_socket.c_str());
+ serverSocket = boost::shared_ptr<TServerSocket>(new TServerSocket(domain_socket));
+ port = 0;
+ } else {
serverSocket = boost::shared_ptr<TServerSocket>(new TServerSocket(port));
- }
+ }
}
// Factory