Skip to content

fix(ssl): SSL key rotation caused request failure#11305

Merged
AlinsRan merged 5 commits into
apache:masterfrom
AlinsRan:fix/ssl-key-rotation
Jun 3, 2024
Merged

fix(ssl): SSL key rotation caused request failure#11305
AlinsRan merged 5 commits into
apache:masterfrom
AlinsRan:fix/ssl-key-rotation

Conversation

@AlinsRan

Copy link
Copy Markdown
Contributor

Description

Due to the failure to handle the OpenSSL error generated during the AES decryption process, this error was caught by Nginx during the TLS handshake request, resulting in the request failure.

In the scenario of key rotation, due to the attempt to traverse all keys and attempt decryption, the error messages generated earlier should be ignored when decryption is successful.

reference:

Fixes #11148

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Comment thread apisix/ssl.lua Outdated
nic-6443
nic-6443 previously approved these changes May 31, 2024
moonming
moonming previously approved these changes May 31, 2024
Comment thread apisix/ssl.lua
@AlinsRan
AlinsRan dismissed stale reviews from moonming and nic-6443 via f9c7267 June 1, 2024 11:42
@moonming

moonming commented Jun 2, 2024

Copy link
Copy Markdown
Member

@AlinsRan please make the code linter happy

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

@AlinsRan why was this issue occuring only after apisix version upgrade?

@AlinsRan

AlinsRan commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

@AlinsRan why was this issue occuring only after apisix version upgrade?

@shreemaan-abhishek Because a ssl key rotation occurred.
edd1c9f0985e76a1 -> qeddd145sfvddff3
Related to #10771

Comment thread t/admin/ssl4.t
- qeddd145sfvddff3
--- error_log
decrypt ssl key failed
[alert]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because the error generated by decryption has been cleared, ngx will not throw this error.

@shreemaan-abhishek shreemaan-abhishek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@membphis membphis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@AlinsRan
AlinsRan merged commit d106de5 into apache:master Jun 3, 2024
@pfernandes21

Copy link
Copy Markdown

Hi, I'm experiencing this issue as well. Do you have any planned release for this? Thanks!

@moonming

Copy link
Copy Markdown
Member

A new version is expected to be released by the end of July. You can also patch this PR in the previous version first @pfernandes21

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.

bug: SSL error migrating to APISIX 3.9.0

7 participants