diff --git a/source/SharedCrtResourceManager.cpp b/source/SharedCrtResourceManager.cpp index 25e9f2e4..115a1863 100644 --- a/source/SharedCrtResourceManager.cpp +++ b/source/SharedCrtResourceManager.cpp @@ -346,7 +346,7 @@ int SharedCrtResourceManager::establishConnection(const PlainConfig &config) TAG, "Attempting to establish MQTT connection with proxy: %s:%u", proxyOptions.HostName.c_str(), - proxyConfig.proxyPort.value()); + proxyOptions.Port); if (proxyConfig.httpProxyAuthEnabled) { diff --git a/source/tunneling/SecureTunnelingContext.cpp b/source/tunneling/SecureTunnelingContext.cpp index 9ee4dccb..1d5e48c9 100644 --- a/source/tunneling/SecureTunnelingContext.cpp +++ b/source/tunneling/SecureTunnelingContext.cpp @@ -28,7 +28,7 @@ namespace Aws const int port, const OnConnectionShutdownFn &onConnectionShutdown) : mSharedCrtResourceManager(manager), mRootCa(rootCa.has_value() ? rootCa.value() : ""), - mAccessToken(accessToken), mEndpoint(endpoint), mPort(port), isHTTPProxyEnabled(false), + mAccessToken(accessToken), mEndpoint(endpoint), mPort(port), mOnConnectionShutdown(onConnectionShutdown) { } @@ -42,7 +42,7 @@ namespace Aws const int port, const OnConnectionShutdownFn &onConnectionShutdown) : mSharedCrtResourceManager(manager), mProxyOptions(proxyOptions), mRootCa(rootCa.has_value() ? rootCa.value() : ""), - mAccessToken(accessToken), mEndpoint(endpoint), mPort(port), isHTTPProxyEnabled(true), + mAccessToken(accessToken), mEndpoint(endpoint), mPort(port), mOnConnectionShutdown(onConnectionShutdown) { } @@ -205,9 +205,7 @@ namespace Aws const Aws::Iotsecuretunneling::OnStreamReset &onStreamReset, const Aws::Iotsecuretunneling::OnSessionReset &onSessionReset) { - // const Aws::Crt::Http::HttpClientConnectionProxyOptions& proxyOptions = mProxyOptions; - - if (isHTTPProxyEnabled) { + if (mProxyOptions.HostName.length() > 0) { LOGM_INFO(TAG, "Creating Secure Tunneling with proxy to: %s", mProxyOptions.HostName.c_str()); return std::make_shared( mSharedCrtResourceManager->getAllocator(), diff --git a/source/tunneling/SecureTunnelingContext.h b/source/tunneling/SecureTunnelingContext.h index abc4518c..dab946c0 100644 --- a/source/tunneling/SecureTunnelingContext.h +++ b/source/tunneling/SecureTunnelingContext.h @@ -212,11 +212,6 @@ namespace Aws */ uint16_t mPort{22}; - /** - * \brief boolean for HTTP proxy enablement - */ - bool isHTTPProxyEnabled; - /** * \brief Callback when the secure tunnel is shutdown */ diff --git a/source/tunneling/SecureTunnelingFeature.cpp b/source/tunneling/SecureTunnelingFeature.cpp index 97972cc9..1d496675 100644 --- a/source/tunneling/SecureTunnelingFeature.cpp +++ b/source/tunneling/SecureTunnelingFeature.cpp @@ -134,13 +134,6 @@ namespace Aws if (!config.tunneling.subscribeNotification) { auto context = createContext(*config.tunneling.destinationAccessToken, *config.tunneling.region, static_cast(config.tunneling.port.value())); - // auto context = unique_ptr(new SecureTunnelingContext( - // mSharedCrtResourceManager, - // mRootCa, - // *config.tunneling.destinationAccessToken, - // GetEndpoint(*config.tunneling.region), - // static_cast(config.tunneling.port.value()), - // bind(&SecureTunnelingFeature::OnConnectionShutdown, this, placeholders::_1))); mContexts.push_back(std::move(context)); } }