version 1.3, 2003/09/11 18:50:28
|
version 1.10, 2005/01/27 18:57:33
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2004//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// Tony Fiorentino (fiorentino_tony@emc.com) | // Tony Fiorentino (fiorentino_tony@emc.com) |
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) | // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// Jair Santos, Hewlett-Packard Company (jair.santos@hp.com) | // Jair Santos, Hewlett-Packard Company (jair.santos@hp.com) |
|
// Dan Gorey, IBM (djgorey@us.ibm.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
configManager->getCurrentValue("enableHttpConnection"), "true"); | configManager->getCurrentValue("enableHttpConnection"), "true"); |
Boolean enableHttpsConnection = String::equal( | Boolean enableHttpsConnection = String::equal( |
configManager->getCurrentValue("enableHttpsConnection"), "true"); | configManager->getCurrentValue("enableHttpsConnection"), "true"); |
|
Boolean enableSSLExportClientVerification = String::equal( |
|
configManager->getCurrentValue("enableSSLExportClientVerification"), "true"); |
| |
if (!enableHttpConnection && !enableHttpsConnection) | if (!enableHttpConnection && !enableHttpsConnection) |
{ | { |
|
|
| |
Uint32 portNumberHttps; | Uint32 portNumberHttps; |
Uint32 portNumberHttp; | Uint32 portNumberHttp; |
|
Uint32 portNumberExportHttps; |
| |
if (enableHttpsConnection) | if (enableHttpsConnection) |
{ | { |
|
|
portNumberHttp = System::lookupPort(WBEM_HTTP_SERVICE_NAME, port); | portNumberHttp = System::lookupPort(WBEM_HTTP_SERVICE_NAME, port); |
} | } |
| |
|
if (enableSSLExportClientVerification) |
|
{ |
|
// |
|
// No config property is looked up to get the default port number. |
|
// Lookup the port defined in /etc/services for the service name |
|
// wbem-exp-https and bind to that port. If the service is not defined |
|
// then log a warning message and do not start the cimserver. |
|
// |
|
Uint32 port = 0; |
|
|
|
portNumberExportHttps = System::lookupPort(WBEM_EXPORT_HTTPS_SERVICE_NAME, port); |
|
|
|
if (portNumberExportHttps == 0) |
|
{ |
|
Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING, |
|
"src.Server.cimserver.EXPORT_HTTPS_PORT_NOT_DEFINED", |
|
"Port not defined for the service wbem-exp-https. CIMServer will not be started."); |
|
|
|
MessageLoaderParms parms("src.Server.cimserver.EXPORT_HTTPS_PORT_NOT_DEFINED", |
|
"Port not defined for the service wbem-exp-https. CIMServer will not be started."); |
|
|
|
cerr << MessageLoader::getMessage(parms) << endl; |
|
} |
|
} |
|
|
// Set up the Logger | // Set up the Logger |
String logsDirectory = String::EMPTY; | String logsDirectory = String::EMPTY; |
logsDirectory = configManager->getCurrentValue("logdir"); | logsDirectory = configManager->getCurrentValue("logdir"); |
|
|
| |
// Put server start message to the logger | // Put server start message to the logger |
Logger::put(Logger::STANDARD_LOG, PEGASUS_SERVICE_NAME, Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, PEGASUS_SERVICE_NAME, Logger::INFORMATION, |
"Started $0 version $1.", PEGASUS_NAME, PEGASUS_VERSION); |
"Started $0 version $1.", PEGASUS_PRODUCT_NAME, PEGASUS_PRODUCT_VERSION); |
| |
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
try | try |
|
|
| |
if (enableHttpConnection) | if (enableHttpConnection) |
{ | { |
server_windows->addAcceptor(false, portNumberHttp, false); |
server_windows->addAcceptor(false, portNumberHttp, false, false); |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"Listening on HTTP port $0.", portNumberHttp); | "Listening on HTTP port $0.", portNumberHttp); |
} | } |
if (enableHttpsConnection) | if (enableHttpsConnection) |
{ | { |
server_windows->addAcceptor(false, portNumberHttps, true); |
server_windows->addAcceptor(false, portNumberHttps, true, false); |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"Listening on HTTPS port $0.", portNumberHttps); | "Listening on HTTPS port $0.", portNumberHttps); |
} | } |
|
if (enableSSLExportClientVerification) |
|
{ |
|
server_windows->addAcceptor(false, portNumberExportHttps, true, true); |
|
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
|
"Listening on HTTPS port $0.", portNumberExportHttps); |
|
} |
| |
server_windows->bind(); | server_windows->bind(); |
| |
|
|
} | } |
} | } |
} | } |
|
|