Skip to content
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

Crash with certificates using Tableau Cloud secure server #4666

Open
DevBreakpoint opened this issue Sep 5, 2024 · 2 comments
Open

Crash with certificates using Tableau Cloud secure server #4666

DevBreakpoint opened this issue Sep 5, 2024 · 2 comments
Labels

Comments

@DevBreakpoint
Copy link

DevBreakpoint commented Sep 5, 2024

We're encountering a crash when trying to log in to a Tableau Cloud server via HTTPS in our C++ application. The issue occurs in Poco's X509Certificate constructor, where the pCert parameter is not initialized, leading to a junk value in the _pCert member variable. This results in a crash during the call to CertDuplicateCertificateContext().
Here’s a snippet of the relevant code:
X509Certificate::X509Certificate(PCCERT_CONTEXT pCert, bool shared):
_pCert(pCert)
{
poco_check_ptr(_pCert);
if (shared)
{
_pCert = CertDuplicateCertificateContext(_pCert);
}
init();
}
The same Tableau Cloud server works fine in a browser, and we've also successfully logged in using C# .NET. Both without providing a certificate or keys.
The Tableau Servers work as expected within our application, the problem seems to stem from a different code path taken by Poco when setting up the HTTPS connection or at least with a secure Table Cloud server.

Here’s how the HTTPSClientSession is set up in our code:
const Poco::Net::Context::Ptr context = new Poco::Net::Context(Poco::Net::Context::CLIENT_USE, "", "", "",
Poco::Net::Context::VERIFY_NONE,
9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@strength");
sessionSSL = new HTTPSClientSession(uri.getHost(), uri.getPort(), context);
sessionSSL->setKeepAlive(true);

This is the stacktrace:

poco_stacktrace

We are currently using Poco v.1.13 and Windows 11. Visual Studio 2019 using msvc compiler.

Are there known issues with certificate initialization or SSL context handling in this version of Poco?
Any recommended fixes or workarounds for ensuring pCert is properly initialized?
Any guidance or suggestions would be much appreciated. Thanks!

@matejk
Copy link
Contributor

matejk commented Sep 5, 2024

Thank you very much.

Can you create a PR with code changes that resolve the problem and unit tests?

@DevBreakpoint
Copy link
Author

Thank you very much.

Can you create a PR with code changes that resolve the problem and unit tests?

Thanks for your response. I just wanted to clarify that I am reporting the issue as a user and unfortunately, I can't implement the code changes or create a PR myself. I hope the development team can look into this crash and address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@matejk @DevBreakpoint and others