- // Get raw format attrib value, but defer processing til later since may need to
- // determine format dynamically, and we need the Path for that.
- format_xml=crlnode->getAttributeNS(NULL,format);
-
- e=XMLHelper::getFirstChildElement(crlnode,Path);
- if (e && e->hasChildNodes()) {
- const XMLCh* s=e->getFirstChild()->getNodeValue();
- auto_ptr_char kpath(s);
- m_crlpath=kpath.get();
- XMLToolingConfig::getConfig().getPathResolver()->resolve(m_crlpath, PathResolver::XMLTOOLING_CFG_FILE);
-#ifdef WIN32
- struct _stat stat_buf;
- if (_stat(m_crlpath.c_str(), &stat_buf) != 0)
-#else
- struct stat stat_buf;
- if (stat(m_crlpath.c_str(), &stat_buf) != 0)
-#endif
- {
- log.error("CRL file (%s) can't be opened", m_crlpath.c_str());
- throw XMLSecurityException("FilesystemCredentialResolver can't access CRL file ($1)",params(1,m_crlpath.c_str()));
+ string crlformat = XMLHelper::getAttrString(crlnode, nullptr, _format);
+ e = XMLHelper::getFirstChildElement(crlnode, Path);
+ while (e) {
+ if (e->hasChildNodes()) {
+ m_crls.push_back(ManagedCRL());
+ ManagedResource& crl = m_crls.back();
+ crl.format = crlformat;
+ prop = e->getFirstChild()->getNodeValue();
+ auto_ptr_char crlpath(prop);
+ crl.source = crlpath.get();
+ XMLToolingConfig::getConfig().getPathResolver()->resolve(crl.source, PathResolver::XMLTOOLING_CFG_FILE);
+ crl.local = true;
+ crl.reloadChanges = XMLHelper::getAttrBool(e, true, _reloadChanges);
+ }
+ e = XMLHelper::getNextSiblingElement(e, Path);
+ }
+
+ e = XMLHelper::getFirstChildElement(crlnode, _URL);
+ while (e) {
+ if (e->hasChildNodes()) {
+ m_crls.push_back(ManagedCRL());
+ ManagedResource& crl = m_crls.back();
+ crl.format = crlformat;
+ prop = e->getFirstChild()->getNodeValue();
+ auto_ptr_char crlpath(prop);
+ crl.source = crlpath.get();
+ crl.local = false;
+ crl.backing = XMLHelper::getAttrString(e, nullptr, backingFilePath);
+ if (crl.backing.empty())
+ throw XMLSecurityException("FilesystemCredentialResolver can't access CRL, backingFilePath missing from URL element.");
+ XMLToolingConfig::getConfig().getPathResolver()->resolve(crl.backing, PathResolver::XMLTOOLING_RUN_FILE);
+ crl.reloadInterval = XMLHelper::getAttrInt(e, 0, _reloadInterval);