Skip to content

Use ConnectionCustomizer to ensure login is only done when needed - #4

Merged
sbihel merged 3 commits into
spruceid:mainfrom
middagj:login
Sep 8, 2025
Merged

Use ConnectionCustomizer to ensure login is only done when needed#4
sbihel merged 3 commits into
spruceid:mainfrom
middagj:login

Conversation

@middagj

@middagj middagj commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

This solves the problem of the multiple Login calls. There does not seem a way to force a specific ConnectionCustomizer on the pool, but I guess users will find out soon enough if their login does not work.

Note that the TODO comment was slightly incorrect. When a Session is dropped, cryptoki does not do a Logout, but it simply does a CloseSession. When all sessions are closed, you need to login again.

I did some extensive testing with our Utimaco CryptoServer library. It seems to work, even when reconnecting in the library.

@middagj

middagj commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

@sbihel any chance you could give this PR a review?

@sbihel sbihel 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.

Thank you for the PR, and apologies for the delay!

I haven't been able to test with other HSMs, but I believe it should work well with something like AWS CloudHSM.

I will merge this PR and publish a release candidate.

@sbihel
sbihel merged commit d33d256 into spruceid:main Sep 8, 2025
1 check passed
@middagj
middagj deleted the login branch September 8, 2025 12:46
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