Skip to content

Git: Connection can't be established behind proxy with Kerberos authentication #9751

Closed

Description

@draganbjedov

Apache NetBeans version

Apache NetBeans 32 latest release candidate

What happened

When I try to push it fails with NoClassDefFoundError

[email protected]:draganbjedov/suspend-timer-swing.git: DefaultConnectFuture[[email protected]/140.82.121.3:22]: Failed (RuntimeSshException) to execute: java.lang.NoClassDefFoundError: org/ietf/jgss/GSSException

Language / Project Type / NetBeans Component

Java Maven Project

How to reproduce

Open project cloned from GitHub
Make a change and commit - Note I have activated SSH signing
Try to push

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11

JDK

Graal VM JDK 25

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Activity

  1. added
    kind:bug
    needs:triage
    on Oct 26, 2026
  2. neilcsmith-net commented on Oct 26, 2026

    @neilcsmith-net
    Member

    Graal VM JDK 25

    Strictly speaking, not a supported platform. Please check against an equivalent OpenJDK. Looks like it might be a module missing or not loading in the JDK?

  3. draganbjedov commented on Oct 26, 2026

    @draganbjedov
    Author

    I have tried with Eclipse Temurin and same issue
    Product Version: Apache NetBeans IDE 32-rc2
    Java: 25.0.4.1; OpenJDK 64-Bit Server VM 25.0.4.1+1-LTS
    Runtime: OpenJDK Runtime Environment 25.0.4.1+1-LTS
    System: Windows 11 version 10.0 running on amd64; UTF-8; en_US (nb)

  4. added
    git
    on Oct 26, 2026
  5. added this to the NB32 milestone on Oct 26, 2026
  6. neilcsmith-net commented on Oct 26, 2026

    @neilcsmith-net
    Member

    OK, thanks for checking. Marking NB32 milestone for now. If you can share a log, that might be useful.

    @matthiasblaesing @mbien thoughts on this given recent changes?

  7. matthiasblaesing commented on Oct 26, 2026

    @matthiasblaesing
    Contributor

    @draganbjedov please provide the message.log from the run where the problem occurred. The folder can be found by opening the "User directory" directory as shown in Help -> About and from there open the subfolder "var/log". The log is in that folder.

  8. draganbjedov commented on Oct 27, 2026

    @draganbjedov
    Author

    @matthiasblaesing @mbien Here are the logs:

    messages-system-proxy.log
    messages-system-proxy-without-config.log
    messages-manual-without-config.log
    messages-manual-proxy.log
    messages-no-proxy.log
    messages-no-proxy-without-config.log

    I'm on company network with proxy which requires authentication with username and password.
    Note that my repository is cloned with SSH.

    I have special setting for github.com in .ssh/config. I tried without it as well.

    Host github.com
       HostName github.com
       ServerAliveInterval 55
       ForwardAgent yes
       ProxyCommand "C:\Users\Dragan\AppData\Local\Programs\Git\mingw64\bin\connect.exe" -H proxy.muc:8080 %h %p
    
  9. neilcsmith-net commented on Oct 27, 2026

    @neilcsmith-net
    Member

    One thing that looks suspicious in the top logs is leading up to the exception in the initial report. Felix not finding something it should be?

    INFO [org.netbeans.modules.git.ui.push.PushBranchesStep]: f65d48a51052b73ad0177a84c729d7024dd6b3ab, main
    java.lang.ClassNotFoundException: org.ietf.jgss.GSSException not found by org.eclipse.jgit.ssh.apache [181]
    	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
    	at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
    	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
    
  10. neilcsmith-net commented on Oct 27, 2026

    @neilcsmith-net
    Member

    Out of interest, does running using

    netbeans -J-Dorg.osgi.framework.system.packages.extra=org.ietf.jgss
    

    help at all?

  11. matthiasblaesing commented on Oct 27, 2026

    @matthiasblaesing
    Contributor

    @draganbjedov could you please test both of these variants:

    netbeans -J-Dorg.osgi.framework.system.packages.extra=org.ietf.jgss
    netbeans -J-Dorg.osgi.framework.bootdelegation=org.ietf.jgss
    

    From reading the description of both parameters and the Apache Felix code, I think that the first variant should not change anything. I read this code:

    so that the modules are scanned for their exported packages. That would mean, that the required package is part of that list:

    https://docs.oracle.com/en/java/javase/21/docs/api/java.security.jgss/module-summary.html

    I checked with a debugger and indeed the configuration of the framework holds a long list of packages for org.osgi.framework.system.packages and part of that list is: , org.ietf.jgss; version="0.0.0.JavaSE_021",.

    Changing the list using org.osgi.framework.system.packages.extra would, to my understanding, only change the packages that are made available to bundle for importing. The problem I see is, that org.eclipse.jgit.ssh.apache does not import the org.ietf.jgss. That is the reason why I think using org.osgi.framework.bootdelegation could work, as loading should then be delegated to the JDK classloader.

  12. changed the title [-]Push does not work[/-] [+]Git: Connection can't be established behind proxy with Kerberos authentication[/+] on Oct 27, 2026
  13. neilcsmith-net commented on Oct 27, 2026

    @neilcsmith-net
    Member

    12. The problem I see is, that org.eclipse.jgit.ssh.apache does not import the org.ietf.jgss.

    Oops, good spot. I'd thought I'd checked the imports, but it was in the Apache sshd module not that one. I notice that the JGit module doesn't import any packages from the JDK, and the Apache one imports all the ones it needs??!! 🤷

  14. neilcsmith-net commented on Oct 27, 2026

    @neilcsmith-net
    Member

    Ah, so it looks like Felix sets that boot delegation property to java.* by default at https://github.com/apache/felix-dev/blob/af89814b23137c8f22593b7d8b37b264f0f7b94a/framework/src/main/java/org/apache/felix/framework/Felix.java#L408 So I assume that's why everything else works without specific import.

  15. 7 remaining items

  16. matthiasblaesing commented on Oct 27, 2026

    @matthiasblaesing
    Contributor

    @draganbjedov ok, that are the correct invocations and locally these worked for me. But anyway, the two approaches for fixing this already produced nightlies:

    If the theories hold both should work. So it would be great if you could test both nightlies and report back with test results. If they fail the full stack trace for exceptions would be relevant. Thank you!

    The idea for the nightlies is that you should not need to mess with command line arguments.

  17. neilcsmith-net commented on Oct 28, 2026

    @neilcsmith-net
    Member

    C:\Users\Dragan\Downloads\netbeans-32-rc2\bin.osgi.framework.bootdelegation=org.ietf.jgss does not exist, or is not a plain file.

    Mainly checked this for future references. Looks like Windows (at least testing Powershell) requires you to quote the flag, or NetBeans is getting the .osgi.fr... bit as a file to open. Seems odd, but can see the different highlighting in the terminal.

    So, ideally please try the nightlies, but to fix your previous launch issue use

    .\netbeans64.exe "-J-Dorg.osgi.framework.bootdelegation=org.ietf.jgss"
    
  18. added 2 commits that reference this issue on Oct 28, 2026
    03fc8c3
    64cb18e
  19. matthiasblaesing commented on Oct 28, 2026

    @matthiasblaesing
    Contributor

    Good news: Using the ZAP Attack proxy I was able to simulate the problem locally. I inject WWW-Authenticate: Negotiate as header, causing the JGSS codepath to be invoked. This leads to slightly different problem as before the Proxy authentication failed (and pointed to the org.eclipse.jgit.ssh.apache module) while I see the problem for org.eclipse.jgit.

    The bad news: I managed to check in eclipse with a debugger and the situation is slightly more complicated. I placed a method breakpoint onto org.eclipse.osgi.internal.framework.EquinoxContainer#isBootDelegationPackage as that would have interested me anyway and then it got interesting. I checked the configuration and got:

    • bootDelegationSteams was null
    • bootDelegation was an empty HashSet
    • bootDelegationAll was false

    So no, there seemed to be no delegation be present. And then I dug deeper and found this gem:

    https://github.com/eclipse-equinox/equinox/blob/cf69a894b8ee6b25921943b4280107584a91ab7e/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java#L553-L565

    And indeed checking the config object in the container I find the field compatibilityBootDelegation and that is true.

    I verified with a breakpoint in the BundleLoader that that codepath is indeed taken.

    Additional twist, this true by default:

    https://github.com/eclipse-equinox/equinox/blob/cf69a894b8ee6b25921943b4280107584a91ab7e/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java#L232-L240

    I think both solutions are viable, in the long run jgit needs to be fixed and we'll never know what else is broken unless we put it into the wild. The bootdelegation variant is uglier than in equinox compatibilityBootDelegation as that is a last resort, while boot delegation is an override.

    I'm inclined to go with the jgss patches and see the fallout hope that the jgit developers agree, that hitting the fallback path in eclipse is not a sustainable solution.

    Edit: I updated #9755 to path both org.eclipse.jgit and org.eclipse.jgit.ssh.apache. I updated the links in #9751 (comment) in place.

  20. matthiasblaesing commented on Oct 29, 2026

    @matthiasblaesing
    Contributor

    @draganbjedov could you please test both of the nightlies as described in #9751 (comment)? This is kind of important as your setup is somewhat special (Kerberos is normally only distributed in Windows-Company Networks), so testing is really ugly for that case.

  21. draganbjedov commented on Nov 2, 2026

    @draganbjedov
    Author

    @matthiasblaesing sorry for late response. I have tested both. Exception ClassNotFoundException is fixed in both nightlies .
    Now I have timeouts:

    messages-9756.log
    messages-system-9755.log
    messages-manual-9755.log

    Note: Push from command line also take some time. See what I set in ~/.ssh/config

    Host github.com
       HostName github.com
       ServerAliveInterval 55
       ForwardAgent yes
       ProxyCommand "C:\Users\Dragan\AppData\Local\Programs\Git\mingw64\bin\connect.exe" -H proxy.muc:8080 %h %p
    

    Is there a way to configure timeout?

  22. matthiasblaesing commented on Nov 2, 2026

    @matthiasblaesing
    Contributor

    @draganbjedov did this ever work? What are your proxy settings for the IDE? There was a real problem with the jgit modules, but the connection problem feels different (different as in "the common hell you are faced when working in corporate networks").

  23. draganbjedov commented on Nov 2, 2026

    @draganbjedov
    Author

    I was not using it before because SSH signing was not supported. With 32rc SSH signing works. I tried push in order to work inside IDE, so I do not need to use terminal.
    You can see in logs I shared that I tried manual proxy settings and system proxy settings.

  24. matthiasblaesing commented on Nov 2, 2026

    @matthiasblaesing
    Contributor

    @neilcsmith-net I'd like to split the connection problem from the exception. I think the problem for the release is primary the exception that I would prefer to fix using the PR #9755 (fix the jgit jars, not the boot delegation PR). My preference for the boot delegation PR was based on the wrong assumption, that equinox used boot delegation for all the JDK packages, but the equinox mechanism is actually less radical and a last resort, not a direct delegation.

    @draganbjedov my experience with timeouts in networks is that you are running against a firewall. The port (8080) indicates, that this is a http proxy. The code currently defaults to socks proxy:

    List<Proxy> proxies = ProxySelector.getDefault().select(
    new URI("socket",
    null,
    isa.getHostString(),
    isa.getPort() == -1 ? 22 : isa.getPort(),
    null, null, null));
    if (!proxies.isEmpty()) {
    Proxy p = proxies.iterator().next();
    if (p.type() == Proxy.Type.DIRECT) {
    return null;
    } else if (USE_PROXY_TUNNELING) {
    return new ProxyData(new Proxy(Proxy.Type.HTTP, p.address()));
    } else {
    return new ProxyData(new Proxy(Proxy.Type.SOCKS, p.address()));
    }
    }

    please see if running netbeans like this helps: netbeans64.exe "-J-Dgit.lib.proxyHttpTunneling=true". That should switch you from using socks tunneling to http tunneling (using http CONNECT).

  25. neilcsmith-net commented on Nov 2, 2026

    @neilcsmith-net
    Member

    @matthiasblaesing sounds good to me. Not patching third party JARs is preferable if we can achieve the same thing another way, but not always feasible. Let's hope they accept your fix soon. Removed label off the PR. Thanks for diving into this! 😄

  26. draganbjedov commented on Nov 24, 2026

    @draganbjedov
    Author

    I have tested latest release NetBeans 32.
    Push works with system proxy settings and -J-Dgit.lib.proxyHttpTunneling=true.

  27. matthiasblaesing commented on Nov 28, 2026

    @matthiasblaesing
    Contributor

    @draganbjedov thanks for reporting back! Could you please run this code on your system and report back with the result?

    Create a file ProxySelector.java:

    import java.net.ProxySelector;
    import java.net.URI;
    
    public class ProxySelectorCheck {
        public static void main(String[] args) {
            ProxySelector ps = ProxySelector.getDefault();
            System.out.println(ps.select(URI.create("socket://github.com:22")));
            System.out.println(ps.select(URI.create("https://github.com:443")));
        }
    }

    and run it with java -Djava.net.useSystemProxies=true ProxySelectorCheck.java. The idea here is to get an idea what type of proxies are reported by your setup. You'll get output like this:

    matthias@enterprise:~/tmp/java$ java -Djava.net.useSystemProxies=true ProxySelectorCheck.java 
    [SOCKS @ localhost/<unresolved>:12345]
    [HTTP @ localhost/<unresolved>:8080]
    matthias@enterprise:~/tmp/java$ 
    

    You can mask the host name, but please don't mask the ports or proxy types.

    My gut feeling is, that having a http proxy in a corporate setup is more common, than having a socks proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gitkind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions