Skip to content

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

Open
golang/crypto
#280
@ydnar

Description

@ydnar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalProposal-CryptoProposal related to crypto packages or other security issues

    Type

    No type

    Projects

    • Status

      Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions