Skip to content

Commit

Permalink
fix TLS enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoForge committed Jun 9, 2022
1 parent 0c1fa13 commit f8f97c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError(strprintf(_("Cannot find trusted certificates directory: '%s'"), pathTLSTrustredDir.string()));
}

if (!usingGUI) {
SoftSetArg("-tlsenforcement", std::string("0"));
}

#if ENABLE_ZMQ
pzmqNotificationInterface = CZMQNotificationInterface::CreateWithArguments(mapArgs);

Expand Down
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest)
NODE_ADDR nodeAddr(addrConnect.ToStringIP());

bool bTlsEnforcement = (GetBoolArg("-tlsenforcement", true) || GetArg("-tlsenforcement", "") == "1");
bool bUseTLS = bTlsEnforcement && (find(vNonTLSNodesOutbound.begin(),
bool bUseTLS = (find(vNonTLSNodesOutbound.begin(),
vNonTLSNodesOutbound.end(),
nodeAddr) == vNonTLSNodesOutbound.end());
unsigned long err_code = 0;
Expand Down Expand Up @@ -1316,7 +1316,7 @@ if (CNode::GetTlsFallbackNonTls())
NODE_ADDR nodeAddr(addr.ToStringIP());

bool bTlsEnforcement = (GetBoolArg("-tlsenforcement", true) || GetArg("-tlsenforcement", "") == "1");
bool bUseTLS = bTlsEnforcement && (find(vNonTLSNodesInbound.begin(),
bool bUseTLS = (find(vNonTLSNodesInbound.begin(),
vNonTLSNodesInbound.end(),
nodeAddr) == vNonTLSNodesInbound.end());
unsigned long err_code = 0;
Expand Down

0 comments on commit f8f97c9

Please sign in to comment.