Changeset - 8ef6fb320ae8
[Not reviewed]
0 2 0
Vitaly Takmazov - 9 years ago 2016-04-27 13:16:49
vitalyster@gmail.com
spectrum2_manager: enable SSL only when using OpenSSL library
2 files changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/CMakeLists.txt
Show inline comments
 
@@ -7,8 +7,9 @@ ADD_DEPENDENCIES(spectrum2_manager pb)
 
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.pb.cc PROPERTIES GENERATED 1)
 

	
 
target_link_libraries(spectrum2_manager transport ${SWIFTEN_LIBRARY} ${PROTOBUF_LIBRARIES})
 

	
 
if (${OPENSSL_FOUND})
 
add_definitions(-DMG_ENABLE_SSL)
 
endif()
 
if (CMAKE_COMPILER_IS_GNUCXX)
 
target_link_libraries(spectrum2_manager ${OPENSSL_LIBRARIES})
 
endif()
spectrum_manager/src/server.cpp
Show inline comments
 
@@ -75,7 +75,7 @@ Server::Server(ManagerConfig *config, const std::string &config_file) {
 
		std::cerr << "Error creating server: " << error_string << "\n";
 
		exit(1);
 
	}
 

	
 
#ifdef MG_ENABLE_SSL
 
	if (!CONFIG_STRING(m_config, "service.cert").empty()) {
 
		const char *err_str = mg_set_ssl(m_nc, CONFIG_STRING(m_config, "service.cert").c_str(), NULL);
 
		if (err_str) {
 
@@ -83,6 +83,7 @@ Server::Server(ManagerConfig *config, const std::string &config_file) {
 
			exit(1);
 
		}
 
	}
 
#endif
 
	mg_set_protocol_http_websocket(m_nc);
 

	
 
	s_http_server_opts.document_root = CONFIG_STRING(m_config, "service.data_dir").c_str();
0 comments (0 inline, 0 general)