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

SSL cache part 2 #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

SSL cache part 2 #9

wants to merge 3 commits into from

Conversation

pluknet
Copy link
Contributor

@pluknet pluknet commented Oct 30, 2024

No description provided.

@pluknet pluknet changed the title Ssl cache part2 SSL cache part 2 Oct 30, 2024

like(http_get('/enc/?cert=e'), qr/CN=e.example.com/, 'encrypted');

# encrypted certificate keys should not spill to the parent cache context
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment no longer reflects what's being verified here. We don't cache the encrypted keys, so there's nothing to leak to another cache context. All the test checks now is that ssl_password_file effect is restricted to the context where it is been set.

my ($t, $old, $new) = @_;

for my $ext ("crt", "key") {
unlink "$d/$old.$ext";
Copy link
Contributor

Choose a reason for hiding this comment

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

Depending on the filesystem implementation, a combination of unlink + write_file may result in reusing the same inode. This is consistently reproducible on Solaris with zfs (both 11.4 CBE and Illumos), but doesn't seem to affect any other of my test systems.

# update /tmp/nginx-test-_KNG2zuMeT/2.example.com.crt: ino 82596160 -> 82596160, mtime 1732479699 -> 1732479699
# update /tmp/nginx-test-_KNG2zuMeT/2.example.com.key: ino 81748352 -> 81748352, mtime 1732479699 -> 1732479699
...
not ok 11 - certificate 2 expired                                                                                                                                                                                                                                                                                                                                                           #   Failed test 'certificate 2 expired'
#   at tests/ssl_certificate_cache.t line 117.
#                   'Subject Name: /CN=2.example.com
# Issuer  Name: /CN=2.example.com
# '
#     doesn't match '(?^:CN=dummy)'

Consider implementing $new branch as write_file($old.$ext.tmp) + rename, just like update_metadata in the other test.


daemon off;

ssl_object_cache_inherit on;
Copy link
Contributor

Choose a reason for hiding this comment

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

"inheritable", following the changes in the nginx PR

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.

2 participants