diff --git a/lib/cpp/test/TSSLSocketInterruptTest.cpp b/lib/cpp/test/TSSLSocketInterruptTest.cpp
index bf5c7d7..85f6c39 100644
--- a/lib/cpp/test/TSSLSocketInterruptTest.cpp
+++ b/lib/cpp/test/TSSLSocketInterruptTest.cpp
@@ -19,13 +19,12 @@
 
 #include <boost/test/auto_unit_test.hpp>
 #include <boost/test/unit_test_suite.hpp>
-#include <boost/bind.hpp>
 #include <boost/chrono/duration.hpp>
 #include <boost/date_time/posix_time/posix_time_duration.hpp>
 #include <boost/thread/thread.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/format.hpp>
-#include <boost/shared_ptr.hpp>
+#include <thrift/stdcxx.h>
 #include <thrift/transport/TSSLSocket.h>
 #include <thrift/transport/TSSLServerSocket.h>
 #ifdef __linux__
@@ -38,6 +37,9 @@
 using apache::thrift::transport::TTransportException;
 using apache::thrift::transport::TSSLSocketFactory;
 
+using apache::thrift::stdcxx::static_pointer_cast;
+using apache::thrift::stdcxx::shared_ptr;
+
 BOOST_AUTO_TEST_SUITE(TSSLSocketInterruptTest)
 
 boost::filesystem::path keyDir;
@@ -92,7 +94,7 @@
 BOOST_GLOBAL_FIXTURE(GlobalFixtureSSL)
 #endif
 
-void readerWorker(boost::shared_ptr<TTransport> tt, uint32_t expectedResult) {
+void readerWorker(shared_ptr<TTransport> tt, uint32_t expectedResult) {
   uint8_t buf[4];
   try {
     tt->read(buf, 1);
@@ -102,7 +104,7 @@
   }
 }
 
-void readerWorkerMustThrow(boost::shared_ptr<TTransport> tt) {
+void readerWorkerMustThrow(shared_ptr<TTransport> tt) {
   try {
     uint8_t buf[400];
     tt->read(buf, 1);
@@ -113,8 +115,8 @@
   }
 }
 
-boost::shared_ptr<TSSLSocketFactory> createServerSocketFactory() {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory;
+shared_ptr<TSSLSocketFactory> createServerSocketFactory() {
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory;
 
   pServerSocketFactory.reset(new TSSLSocketFactory());
   pServerSocketFactory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
@@ -124,8 +126,8 @@
   return pServerSocketFactory;
 }
 
-boost::shared_ptr<TSSLSocketFactory> createClientSocketFactory() {
-  boost::shared_ptr<TSSLSocketFactory> pClientSocketFactory;
+shared_ptr<TSSLSocketFactory> createClientSocketFactory() {
+  shared_ptr<TSSLSocketFactory> pClientSocketFactory;
 
   pClientSocketFactory.reset(new TSSLSocketFactory());
   pClientSocketFactory->authenticate(true);
@@ -136,15 +138,15 @@
 }
 
 BOOST_AUTO_TEST_CASE(test_ssl_interruptable_child_read_while_handshaking) {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
   TSSLServerSocket sock1("localhost", 0, pServerSocketFactory);
   sock1.listen();
   int port = sock1.getPort();
-  boost::shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
-  boost::shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
+  shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
+  shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
   clientSock->open();
-  boost::shared_ptr<TTransport> accepted = sock1.accept();
-  boost::thread readThread(boost::bind(readerWorkerMustThrow, accepted));
+  shared_ptr<TTransport> accepted = sock1.accept();
+  boost::thread readThread(apache::thrift::stdcxx::bind(readerWorkerMustThrow, accepted));
   boost::this_thread::sleep(boost::posix_time::milliseconds(50));
   // readThread is practically guaranteed to be blocking now
   sock1.interruptChildren();
@@ -156,15 +158,15 @@
 }
 
 BOOST_AUTO_TEST_CASE(test_ssl_interruptable_child_read) {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
   TSSLServerSocket sock1("localhost", 0, pServerSocketFactory);
   sock1.listen();
   int port = sock1.getPort();
-  boost::shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
-  boost::shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
+  shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
+  shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
   clientSock->open();
-  boost::shared_ptr<TTransport> accepted = sock1.accept();
-  boost::thread readThread(boost::bind(readerWorkerMustThrow, accepted));
+  shared_ptr<TTransport> accepted = sock1.accept();
+  boost::thread readThread(apache::thrift::stdcxx::bind(readerWorkerMustThrow, accepted));
   clientSock->write((const uint8_t*)"0", 1);
   boost::this_thread::sleep(boost::posix_time::milliseconds(50));
   // readThread is practically guaranteed to be blocking now
@@ -177,17 +179,17 @@
 }
 
 BOOST_AUTO_TEST_CASE(test_ssl_non_interruptable_child_read) {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
   TSSLServerSocket sock1("localhost", 0, pServerSocketFactory);
   sock1.setInterruptableChildren(false); // returns to pre-THRIFT-2441 behavior
   sock1.listen();
   int port = sock1.getPort();
-  boost::shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
-  boost::shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
+  shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
+  shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
   clientSock->open();
-  boost::shared_ptr<TTransport> accepted = sock1.accept();
-  boost::static_pointer_cast<TSSLSocket>(accepted)->setRecvTimeout(1000);
-  boost::thread readThread(boost::bind(readerWorker, accepted, 0));
+  shared_ptr<TTransport> accepted = sock1.accept();
+  static_pointer_cast<TSSLSocket>(accepted)->setRecvTimeout(1000);
+  boost::thread readThread(apache::thrift::stdcxx::bind(readerWorker, accepted, 0));
   clientSock->write((const uint8_t*)"0", 1);
   boost::this_thread::sleep(boost::posix_time::milliseconds(50));
   // readThread is practically guaranteed to be blocking here
@@ -203,14 +205,14 @@
 }
 
 BOOST_AUTO_TEST_CASE(test_ssl_cannot_change_after_listen) {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
   TSSLServerSocket sock1("localhost", 0, pServerSocketFactory);
   sock1.listen();
   BOOST_CHECK_THROW(sock1.setInterruptableChildren(false), std::logic_error);
   sock1.close();
 }
 
-void peekerWorker(boost::shared_ptr<TTransport> tt, bool expectedResult) {
+void peekerWorker(shared_ptr<TTransport> tt, bool expectedResult) {
   uint8_t buf[400];
   try {
     tt->read(buf, 1);
@@ -220,7 +222,7 @@
   }
 }
 
-void peekerWorkerInterrupt(boost::shared_ptr<TTransport> tt) {
+void peekerWorkerInterrupt(shared_ptr<TTransport> tt) {
   uint8_t buf[400];
   try {
     tt->read(buf, 1);
@@ -231,15 +233,15 @@
 }
 
 BOOST_AUTO_TEST_CASE(test_ssl_interruptable_child_peek) {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
   TSSLServerSocket sock1("localhost", 0, pServerSocketFactory);
   sock1.listen();
   int port = sock1.getPort();
-  boost::shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
-  boost::shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
+  shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
+  shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
   clientSock->open();
-  boost::shared_ptr<TTransport> accepted = sock1.accept();
-  boost::thread peekThread(boost::bind(peekerWorkerInterrupt, accepted));
+  shared_ptr<TTransport> accepted = sock1.accept();
+  boost::thread peekThread(apache::thrift::stdcxx::bind(peekerWorkerInterrupt, accepted));
   clientSock->write((const uint8_t*)"0", 1);
   boost::this_thread::sleep(boost::posix_time::milliseconds(50));
   // peekThread is practically guaranteed to be blocking now
@@ -252,17 +254,17 @@
 }
 
 BOOST_AUTO_TEST_CASE(test_ssl_non_interruptable_child_peek) {
-  boost::shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
+  shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory();
   TSSLServerSocket sock1("localhost", 0, pServerSocketFactory);
   sock1.setInterruptableChildren(false); // returns to pre-THRIFT-2441 behavior
   sock1.listen();
   int port = sock1.getPort();
-  boost::shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
-  boost::shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
+  shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory();
+  shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port);
   clientSock->open();
-  boost::shared_ptr<TTransport> accepted = sock1.accept();
-  boost::static_pointer_cast<TSSLSocket>(accepted)->setRecvTimeout(1000);
-  boost::thread peekThread(boost::bind(peekerWorker, accepted, false));
+  shared_ptr<TTransport> accepted = sock1.accept();
+  static_pointer_cast<TSSLSocket>(accepted)->setRecvTimeout(1000);
+  boost::thread peekThread(apache::thrift::stdcxx::bind(peekerWorker, accepted, false));
   clientSock->write((const uint8_t*)"0", 1);
   boost::this_thread::sleep(boost::posix_time::milliseconds(50));
   // peekThread is practically guaranteed to be blocking now
