-
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-31394 WsSMC send roxie control cmd to ssl port if available #18396
HPCC-31394 WsSMC send roxie control cmd to ssl port if available #18396
Conversation
https://track.hpccsystems.com/browse/HPCC-31394 |
I am still working on adding to this PR for using the same port in cascade/lock that was used to reach roxie. |
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.
Approved. I added some code to PR: #18571 for HPCC-31395 for this for testsocket to Roxie.
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.
The change looks good. One question about the way the socket factory is managed etc.
esp/smc/SMCLib/TpWrapper.cpp
Outdated
public: | ||
TlsSmartSocketFactory(const char *_socklist) : CSmartSocketFactory(_socklist) | ||
{ | ||
tlsService = true; |
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.
The encapsulation could be better - it is using an implementation detail of the class. Should this either be an extra parameter to createSmartSocketFactory(), or should it be using createSecureSmartSocketFactory()?
Is there other configuration information (e.g., issuer for mtls) that needs to be provided?
1484215
to
ab71964
Compare
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.
One initial question. I think the code is assuming that a non-null factory is returned from createSecureSocketConfig(nullptr, nullptr, nullptr). Is that a problem?
@@ -677,7 +677,7 @@ int main(int argc, char *argv[]) | |||
{ | |||
#ifdef _USE_OPENSSL | |||
if (useSSL) | |||
smartSocketFactory = createSecureSmartSocketFactory(hosts.str(), retryMode); | |||
smartSocketFactory = createSecureSmartSocketFactory(hosts.str(), createSecureSocketConfig(nullptr, nullptr, nullptr), retryMode); |
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.
createSecureSocketConfig(nullptr, nullptr, nullptr) currently returns null. Is this doing what you expect?
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.
This is what I expect but it may not be clear, and I wasn't sure if other changes would make it better. I thought this could be a placeholder until the usage of the smart socket classes is regularized. If it would be better to have an empty rather than null object here I could adjust the createSecureSocketConfig
to do so or create an alternate function. I can see how this approach may not be clear and will adjust if you'd like.
The use of the smart sockets and factories isn't entirely consistent. In some cases the users of the classes interrogate the base interface for TLS status, and in others the user knows the TLS state and uses the correct secure/insecure flavor based on its own knowledge. roxiepipe is in the second case and it doesn't rely on the smart socket class itself having a valid config, rather it has already created a secure socket version based on the ssl argument (and compile switch).
ab71964
to
d7dc37d
Compare
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.
@asselitx looks good. One question.
system/jlib/jsmartsock.cpp
Outdated
SmartSocketListParser slp(_socklist); | ||
if (slp.getSockets(sockArray) == 0) | ||
throw createSmartSocketException(0, "no endpoints defined"); | ||
|
||
if (_tlsConfig && _tlsConfig->queryName() && streq(_tlsConfig->queryName(), "ssl")) |
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.
Why the check of the name against ssl? It could do with a comment.
(For instance the value created with createIssuerTlsConfig doesn't have that name - but it isn't going through this code path...)
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.
The check does not add value on reconsideration, so I'll remove it and squash my commits.
Initially it seemed reasonable to ensure we had a configuration for SSL/TLS but given the other constructor doesn't explicitly check and has a different format it makes little sense.
d7dc37d
to
83a1255
Compare
I see two failures. The first windows runner build failing in vcpkg step doesn't appear to be related to my changes: |
Rather than default to port 9876, use the roxie farmer ports configured for sending control messages to. Prefer an ssl port if available. Update the smart pointer factory and ctors where required to accept a tls config from bare-metal configurations. These configurations using transitional APIs don't support all the properties and sync features of the containerized versions. A separate ticket would be required to determine if and how to add the full complement of tls related configuration, behavior and secrets support to bare metal that is currently in place in containerized code. Signed-off-by: Terrence Asselin <[email protected]>
83a1255
to
14357e8
Compare
@ghalliday Fixed issue when creating |
3f6374e
into
hpcc-systems:candidate-9.6.x
Rather than default to port 9876, use the roxie farmer ports configured for sending control messages to. Prefer an ssl port if available.
Type of change:
Checklist:
Smoketest:
Testing: