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

feat: generate RSA key lazily for lazy refresh #826

Merged
merged 1 commit into from
Jun 6, 2024
Merged

Conversation

enocom
Copy link
Member

@enocom enocom commented Jun 6, 2024

When lazy refresh is enabled, the RSA key generation will not occur until a client calls Dial. This change helps cold start times in serverless environments.

Prior to this commit, the RSA key generation was done at the package level using globals. This commit removes the use of globals and moves the key generation into the dialer. This means multiple dialers will now have multiple RSA keys. Before this commit, multiple dialers all shared the same RSA key. If this is a concern, callers may still configure their own RSA key across multiple dialers.

Fixes #823

When lazy refresh is enabled, the RSA key generation will not occur
until a client calls Dial. This change helps cold start times in
serverless environments.

Prior to this commit, the RSA key generation was done at the package
level using globals. This commit removes the use of globals and moves
the key generation into the dialer. This means multiple dialers will now
have multiple RSA keys. Before this commit, multiple dialers all shared
the same RSA key. If this is a concern, callers may still configure
their own RSA key across multiple dialers.

Fixes #823
@enocom enocom merged commit bf293e2 into main Jun 6, 2024
13 checks passed
@enocom enocom deleted the lazy-key-gen branch June 6, 2024 23:30
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.

Lazy refresh should delay RSA key generation until first connection attempt
2 participants