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(): add header support for proxy auth #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sandy2008
Copy link

feat(): add header support for proxy auth

@sandy2008
Copy link
Author

@jcmturner Can you take a look at this PR? 🥹

@huaraz
Copy link

huaraz commented Aug 2, 2024

feat(): add header support for proxy auth

I would be interested to test this. How can get access t to this change ?
e.g. add
import "github.com/jcmturner/gokrb5/v8/client" ?

@sandy2008
Copy link
Author

sandy2008 commented Aug 2, 2024

feat(): add header support for proxy auth

I would be interested to test this. How can get access t to this change ? e.g. add import "github.com/jcmturner/gokrb5/v8/client" ?

@huaraz Thank you for your interest in testing the changes!

To get access to this change, you can point your Go module to my fork with the master branch. Here are the steps to do this:

  1. Edit your go.mod file to replace the original module with my fork:
replace github.com/jcmturner/gokrb5/v8 => github.com/sandy2008/gokrb5/v8 master
  1. Run go get to update your dependencies:
go get github.com/jcmturner/gokrb5/v8
  1. You can then import the package as usual:
import "github.com/jcmturner/gokrb5/v8/client"

If you encounter any issues or have further questions, please let me know!

@huaraz
Copy link

huaraz commented Aug 3, 2024

Hi Sandy,

I looked a bit more at the code and I tried what you do in setSPNEGOHeaderCommon earlier myself and it does not work for https i.e. CONNECT method. I had to do the following:

    transport := &http.Transport{
            Proxy:              http.ProxyURL(proxyURL),
            GetProxyConnectHeader: func(ctx context.Context, proxyURL *url.URL, target string) (http.Header, error) {
                                        headers := http.Header{}
                                        headers.Add("Proxy-Authorization", negoAuth)
                                        return headers, nil
                                   },
    }

or use
ProxyConnectHeader: http.Header{"Proxy-Authorization": []string{negoAuth}},

FYI I have not tried your code yet.

Markus

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