THRIFT-4084: Add a SSL/TLS negotiation check to crossfeature to verify SSLv3 is not active and that at least one of TLSv1.0 through 1.2 are accepted.
Client: csharp, d, go, nodejs, perl
This closes #1197
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index da20b89..a918bfb 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -136,8 +136,11 @@
int ERR_EXCEPTIONS = 8;
int ERR_UNKNOWN = 64;
- string testDir = boost::filesystem::system_complete(argv[0]).parent_path().parent_path().parent_path().string();
- string pemPath = testDir + "/keys/CA.pem";
+ string testDir = boost::filesystem::system_complete(argv[0]).parent_path().parent_path().parent_path().string();
+ string caPath = testDir + "/keys/CA.pem";
+ string certPath = testDir + "/keys/client.crt";
+ string keyPath = testDir + "/keys/client.key";
+
#if _WIN32
transport::TWinsockSingleton::create();
#endif
@@ -232,9 +235,15 @@
boost::shared_ptr<TSSLSocketFactory> factory;
if (ssl) {
+ cout << "Client Certificate File: " << certPath << endl;
+ cout << "Client Key File: " << keyPath << endl;
+ cout << "CA File: " << caPath << endl;
+
factory = boost::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
factory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
- factory->loadTrustedCertificates(pemPath.c_str());
+ factory->loadTrustedCertificates(caPath.c_str());
+ factory->loadCertificate(certPath.c_str());
+ factory->loadPrivateKey(keyPath.c_str());
factory->authenticate(true);
socket = factory->createSocket(host, port);
} else {