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

proposal: x/crypto/ssh: add top-level DialContext func #64686

Open
ydnar opened this issue Dec 12, 2023 · 4 comments · May be fixed by golang/crypto#280
Open

proposal: x/crypto/ssh: add top-level DialContext func #64686

ydnar opened this issue Dec 12, 2023 · 4 comments · May be fixed by golang/crypto#280
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Milestone

Comments

@ydnar
Copy link

ydnar commented Dec 12, 2023

Proposal Details

Similar to #20288 which added a DialContext method to ssh.Client, we propose to add a top-level convenience function DialContext to the crypto/ssh package which mirrors the existing Dial func:

func DialContext(ctx context.Context, network, addr string, config *ClientConfig) (*Client, error)

The DialContext func would accept a context.Context as its first argument, which would control the dial and handshake phases of the connection. Closing the Context after the connection is established would have no effect on the resulting Client. This is consistent with other DialContext uses in the Go standard library and this package.

We have a change ready to go (~33 SLOC), so happy to submit a CL when/if this is approved.

@ydnar ydnar added the Proposal label Dec 12, 2023
@gopherbot gopherbot added this to the Proposal milestone Dec 12, 2023
@seankhliao seankhliao added the Proposal-Crypto Proposal related to crypto packages or other security issues label Dec 12, 2023
@ghost
Copy link

ghost commented Dec 13, 2023

Proposal Details

Similar to #20288 which added a DialContext method to ssh.Client, we propose to add a top-level convenience function DialContext to the crypto/ssh package which mirrors the existing Dial func:

func DialContext(ctx context.Context, network, addr string, config *ClientConfig) (*Client, error)

The DialContext func would accept a context.Context as its first argument, which would control the dial and handshake phases of the connection. Closing the Context after the connection is established would have no effect on the resulting Client. This is consistent with other DialContext uses in the Go standard library and this package.

We have a change ready to go (~33 SLOC), so happy to submit a CL when/if this is approved.

@drakkan
Copy link
Member

drakkan commented Dec 16, 2023

LGTM, thanks!

@ydnar ydnar linked a pull request Dec 17, 2023 that will close this issue
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/550096 mentions this issue: ssh: add top-level DialContext

@drakkan
Copy link
Member

drakkan commented Jan 30, 2024

cc @golang/proposal-review this seems like a good addition and something often requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Projects
Status: Incoming
Development

Successfully merging a pull request may close this issue.

4 participants