Changeset 280


Ignore:
Timestamp:
08/11/10 11:17:30 (18 months ago)
Author:
mickem
Message:

parametrized certifaicte file (ish)

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.cmake

    r272 r280  
    2424ELSE(WIN32) 
    2525 
     26SET(INC_BOOST_INCLUDEDIR "/usr/include/") 
     27 
    2628ENDIF(WIN32) 
    2729 
  • trunk/include/nrpe/server/server.cpp

    r279 r280  
    3838      if (info.use_ssl) { 
    3939        SSL_CTX_set_cipher_list(context_.impl(), "ADH"); 
    40         request_handler_->log_debug(__FILEW__, __LINE__, _T("Using file: C:/source/nscp/build/security/nrpe_dh_512.pem")); 
    41         context_.use_tmp_dh_file("C:/source/nscp/build/security/nrpe_dh_512.pem"); 
     40        request_handler_->log_debug(__FILEW__, __LINE__, _T("Using cert: ") + to_wstring(info.certificate)); 
     41        context_.use_tmp_dh_file(info.certificate); 
    4242        context_.set_verify_mode(boost::asio::ssl::context::verify_none); 
    4343      } 
  • trunk/include/nrpe/server/server.hpp

    r278 r280  
    4242        bool use_ssl; 
    4343        boost::shared_ptr<nrpe::server::handler> request_handler; 
    44  
     44        std::string certificate; 
    4545        std::wstring get_endpoint_str() { 
    4646          return to_wstring(address) + _T(":") + to_wstring(port); 
  • trunk/modules/NRPEServer/NRPEServer.cpp

    r278 r280  
    7878  NSC_DEBUG_MSG_STD(_T("Allowed hosts: ") + allowedHosts.to_string()); 
    7979  try { 
     80 
     81    boost::filesystem::wpath p = GET_CORE()->getBasePath() + std::wstring(_T("security/nrpe_dh_512.pem")); 
     82    info_.certificate = to_string(p.string()); 
     83    if (boost::filesystem::is_regular(p)) { 
     84      NSC_LOG_ERROR_STD(_T("Certificate not found: ") + p.string()); 
     85    } 
    8086    info_.port = to_string(SETTINGS_GET_INT(nrpe::PORT)); 
    8187    info_.address = to_string(SETTINGS_GET_STRING(nrpe::BINDADDR)); 
  • trunk/modules/NRPEServer/stdafx.h

    r278 r280  
    3737#include <boost/tuple/tuple.hpp> 
    3838 
     39#include <boost/filesystem.hpp> 
     40 
    3941#ifdef USE_SSL 
    4042#include <boost/asio/ssl.hpp> 
Note: See TracChangeset for help on using the changeset viewer.