cloudfoundry / cloudfoundry/socks5-proxy

NewSocks5Proxy hostKey type is private want to use custom ssh HostKeyCallback

Open
#21 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
55
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Hi all,

I was playing around with this nice package. But needed to dig deep to come to the conclusion the hostType private interface is a single function private interface where the public caller needs to implement

https://github.com/cloudfoundry/socks5-proxy/blob/main/socks5_proxy.go#L22

When I want to extend my CLI tool with SSHFP (ssh DNS host fingerprint) functionality it is not clear. When using this package it is not 100% clear what needs to be passed to the NewSocks5Proxy hostKey parameter. I hacked my CLI tool with a custom Get function and cache the fetched host key. Which is almost the same implementation as the public HostKey type.

UPDATE: It is simpler than I thought with the following code to use the standard mechanism. But this doesn't allow custom host key handling.

hostKey := proxy.NewHostKey()
sshSocks5Proxy := proxy.NewSocks5Proxy(&hostKey, nil, time.Minute)

The package I want to integrate is https://github.com/xor-gate/sshfp so the host key can be trusted using a SSHFP DNS record.

Hopefully this is clear enough, or else please ask.

Long story short: Why is the interface of hostKey type private?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with socks5_proxy.go around line 22 and the NewSocks5Proxy hostKey parameter; compare the private hostType with public HostKey/NewHostKey and the stated SSHFP use case. Done means the intended custom host-key handling is exposed or clearly supported, with the relevant package behavior checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.