mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Throw exception in case SSL is not enabled
This commit is contained in:
parent
10d860acc3
commit
8577938efe
@ -1,5 +1,7 @@
|
||||
#include "StorageMongoDBSocketFactory.h"
|
||||
|
||||
#include <Common/Exception.h>
|
||||
|
||||
#if !defined(ARCADIA_BUILD)
|
||||
# include <Common/config.h>
|
||||
#endif
|
||||
@ -15,6 +17,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int FEATURE_IS_NOT_ENABLED_AT_BUILD_TIME;
|
||||
}
|
||||
|
||||
Poco::Net::StreamSocket StorageMongoDBSocketFactory::createSocket(const std::string & host, int port, Poco::Timespan connectTimeout, bool secure)
|
||||
{
|
||||
return secure ? createSecureSocket(host, port, connectTimeout) : createPlainSocket(host, port, connectTimeout);
|
||||
@ -41,7 +48,7 @@ Poco::Net::StreamSocket StorageMongoDBSocketFactory::createSecureSocket(const st
|
||||
|
||||
return socket;
|
||||
#else
|
||||
return createPlainSocket(host, port, connectTimeout);
|
||||
throw Exception("SSL is not enabled at build time.", ErrorCodes::FEATURE_IS_NOT_ENABLED_AT_BUILD_TIME);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user