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

Issue 6324 - Provide more information in the error message during setup_ol_tls_conn() #6325

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

droideck
Copy link
Member

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code. We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure. Add a test case.

Fixes: #6324

Reviewed by: ?

…up_ol_tls_conn()

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: 389ds#6324

Reviewed by: ?
@droideck
Copy link
Member Author

droideck commented Sep 13, 2024

I'm not sure why but the test passes on my machine (and on a virtual machine). But it can't find the error message in GitHub CI.
Probably, it's because we have Docker here, and the issue is triggered when certificate is removed from systemd tmp.

@progier389
Copy link
Contributor

At least the C code looks good.
About the failing test test I find a bit surprising that we are not seeing any log about the deleted cert files:
cacert list should not be empty of the test would be skipped. And neither successful deletion or failed one are logged.
So I wonder if the delete operation has not failed and our logger does ignore the warning level
Maybe you should rather use log.info (as we know that info are logged!)
And probably worth to log,info(f'ca_files={ca_files}') to help debugging the testcase

@droideck
Copy link
Member Author

Okay, the issue was that I tried to grab the wrong error.

The error I need to check for is: error:80000002:system library::No such file or directory. It is the error that happens during the TLS context set when the cert is missing.

But there's another error that happens earlier in the function. And they are different between GitHub CI and my virtual machine mock run.

GitHub CI - error:0200008A:rsa routines::invalid padding
My env - error:0A000086:SSL routines::certificate verify failed

Why it's different, it's another story I am not sure still.

@vashirov
Copy link
Member

What version of openssl do you have? In the CI image I see openssl-3.2.2-3.fc40

@droideck
Copy link
Member Author

What version of openssl do you have? In the CI image I see openssl-3.2.2-3.fc40

It's the same on my machine - openssl-3.2.2-3.fc40.x86_64

Copy link
Contributor

@progier389 progier389 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@droideck droideck merged commit 82dcdab into 389ds:main Sep 18, 2024
197 checks passed
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
droideck added a commit that referenced this pull request Sep 18, 2024
…up_ol_tls_conn() (#6325)

Description: When there's a problem with creating a new TLS context, we just fail with -1 error code.
We can improve it by providing more information that can be extracted from LDAP_OPT_DIAGNOSTIC_MESSAGE or LDAP_OPT_ERROR_STRING.

Use slapi_ldap_get_lderrno to get more information from the ld structure.
Add a test case.

Fixes: #6324

Reviewed by: @progier389 (Thanks!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide more information in the error message during setup_ol_tls_conn()
3 participants