-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-33260 Allow a BM DFS service+dafilesrv to be secured #19422
base: candidate-9.10.x
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,21 +132,31 @@ static ISecureSocket *createSecureSocket(ISocket *sock, bool disableClientCertVe | |
CriticalBlock b(secureContextCrit); | ||
if (!secureContextServer) | ||
{ | ||
#ifdef _CONTAINERIZED | ||
/* Connections are expected from 3rd parties via TLS, | ||
* we do not expect them to provide a valid certificate for verification. | ||
* Currently the server (this dafilesrv), will use either the "public" certificate issuer, | ||
* unless it's visibility is "cluster" (meaning internal only) | ||
*/ | ||
if (isContainerized()) | ||
{ | ||
/* Connections are expected from 3rd parties via TLS, | ||
* we do not expect them to provide a valid certificate for verification. | ||
* Currently the server (this dafilesrv), will use either the "public" certificate issuer, | ||
* unless it's visibility is "cluster" (meaning internal only) | ||
*/ | ||
|
||
const char *certScope = strsame("cluster", getComponentConfigSP()->queryProp("service/@visibility")) ? "local" : "public"; | ||
Owned<const ISyncedPropertyTree> info = getIssuerTlsSyncedConfig(certScope, nullptr, disableClientCertVerification); | ||
if (!info || !info->isValid()) | ||
throw makeStringException(-1, "createSecureSocket() : missing MTLS configuration"); | ||
secureContextServer.setown(createSecureSocketContextSynced(info, ServerSocket)); | ||
#else | ||
secureContextServer.setown(createSecureSocketContextEx2(securitySettings.getSecureConfig(), ServerSocket)); | ||
#endif | ||
const char *certScope = strsame("cluster", getComponentConfigSP()->queryProp("service/@visibility")) ? "local" : "public"; | ||
Owned<const ISyncedPropertyTree> info = getIssuerTlsSyncedConfig(certScope, nullptr, disableClientCertVerification); | ||
if (!info || !info->isValid()) | ||
throw makeStringException(-1, "createSecureSocket() : missing MTLS configuration"); | ||
secureContextServer.setown(createSecureSocketContextSynced(info, ServerSocket)); | ||
} | ||
else | ||
{ | ||
IPropertyTree *cert = getComponentConfigSP()->getPropTree("cert"); | ||
if (cert) | ||
{ | ||
Owned<ISyncedPropertyTree> certSyncedWrapper = createSyncedPropertyTree(cert); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: cert will be leaked - line 151 should be an owned instance or call queryPropTree There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whoops, should be owned, to avoid theoretical config change and invalidation of it before being used. |
||
secureContextServer.setown(createSecureSocketContextSynced(certSyncedWrapper, ServerSocket)); | ||
} | ||
else | ||
secureContextServer.setown(createSecureSocketContextEx2(securitySettings.getSecureConfig(), ServerSocket)); | ||
} | ||
} | ||
} | ||
int loglevel = SSLogNormal; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial: could combine with the next line (I wouldn't have commented if not only comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be combined. Will change.