Fixed some small certificate issues
This commit is contained in:
parent
47a8b537ca
commit
41fb8415cd
@ -167,11 +167,14 @@ bool SSLManager::unregister_context(const std::string &context) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSLManager::unregister_web_contexts() {
|
void SSLManager::unregister_web_contexts(bool default_as_well) {
|
||||||
{
|
{
|
||||||
lock_guard lock{this->context_lock};
|
lock_guard lock{this->context_lock};
|
||||||
decltype(this->contexts) ctxs{this->contexts};
|
decltype(this->contexts) ctxs{this->contexts};
|
||||||
for(auto& [key, _] : ctxs) {
|
for(auto& [key, _] : ctxs) {
|
||||||
|
if(key == this->web_ctx_prefix + "default" && !default_as_well)
|
||||||
|
continue;
|
||||||
|
|
||||||
(void) _;
|
(void) _;
|
||||||
if(key.find(this->web_ctx_prefix) == 0) {
|
if(key.find(this->web_ctx_prefix) == 0) {
|
||||||
this->contexts.erase(key);
|
this->contexts.erase(key);
|
||||||
|
@ -36,7 +36,7 @@ namespace ts::ssl {
|
|||||||
|
|
||||||
bool unregister_context(const std::string& /* key */);
|
bool unregister_context(const std::string& /* key */);
|
||||||
bool rename_context(const std::string& /* old key */, const std::string& /* new key */); /* if new already exists it will be dropped */
|
bool rename_context(const std::string& /* old key */, const std::string& /* new key */); /* if new already exists it will be dropped */
|
||||||
void unregister_web_contexts();
|
void unregister_web_contexts(bool /* default certificate as well */);
|
||||||
|
|
||||||
std::shared_ptr<SSLKeyPair> initializeSSLKey(const std::string &key, const std::string &rsaKey, std::string &error, bool raw = false);
|
std::shared_ptr<SSLKeyPair> initializeSSLKey(const std::string &key, const std::string &rsaKey, std::string &error, bool raw = false);
|
||||||
std::shared_ptr<SSLContext> initializeContext(const std::string& key, std::string& privateKey, std::string& certificate, std::string& error, bool raw = false, const std::shared_ptr<SSLGenerator>& = nullptr);
|
std::shared_ptr<SSLContext> initializeContext(const std::string& key, std::string& privateKey, std::string& certificate, std::string& error, bool raw = false, const std::shared_ptr<SSLGenerator>& = nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user