title: jenkins pipeline gives "polling failed" Error performing command: git.exe ls-remote -h returned status code 128
body: <p>I have 2 jobs in Jenkins.  One is a regular project, and polls git perfectly fine, every commit, kicks off the job and all is well.  I am taking this project and converting it to a Pipeline project, and it does not trigger when there is a commit to git.  Looking at the GIT POLLING LOG for the regular project gives, with some edits to abbreviate:</p>
  
  <pre><code>Started on Dec 8, 2017 2:04:35 PM
  Polling SCM changes on HOST_158
  Using strategy: Default
  [poll] Last Built Revision: Revision 8cc....3d3 (refs/remotes/origin/master)
   &gt; git.exe rev-parse --is-inside-work-tree # timeout=10
  Fetching changes from the remote Git repositories
   &gt; git.exe config remote.origin.url https://example.com/buildbot/a_tests # timeout=10
  Fetching upstream changes from https://example.com/buildbot/a_tests
   &gt; git.exe --version # timeout=10
  using GIT_ASKPASS to set credentials TokenVBA
  Setting http proxy: proxy.example.com:81
       &gt; git.exe fetch --tags --progress 
  .......
      Done. Took 2.1 sec
  Changes found
  </code></pre>
  
  <p>The same specs with the pipeline project yields the GIT POLLING LOG like this:</p>
  
  <pre><code>    Started on Dec 8, 2017 2:03:35 PM
      Using strategy: Default
      [poll] Last Built Revision: Revision 8cc....3d3 (refs/remotes/origin/master)
      using GIT_ASKPASS to set credentials TokenVBA
      Setting http proxy: proxy.example.com:81
       &gt; git.exe ls-remote -h https://example.com/buildbot/a_tests.git # timeout=10
      ERROR: polling failed in c:/temp/jenkins/workspace/Test Component Installer V1 on HOST_158
  java.io.IOException: hudson.plugins.git.GitException: Command "git.exe ls-remote -h https://example.com/buildbot/swqa_tests" returned status code 128:
  stdout: 
  stderr: fatal: unable to access 'https://example.com/buildbot/swqa_tests/': schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
  
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:596)
      at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:629)
      at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:594)
      at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:640)
      at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: hudson.plugins.git.GitException: Command "git.exe ls-remote -h https://example.com/buildbot/swqa_tests" returned status code 128:
  stdout: 
  stderr: fatal: unable to access 'https://example.com/buildbot/swqa_tests/': schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
  
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1970)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1689)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1600)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1591)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2732)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:635)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:594)
      ... 9 more
  Done. Took 1 min 15 sec
  No changes
  </code></pre>
  
  <ul>
  <li><strong>UPDATED</strong> -> When I Build with Parameters, this same job, the build finds and checks out the revision and processes it as part of the build.  But the polling fails on some certificate issue.  If someone knows how to fix this issue, could you please enlighten me as to why manual build works and polling fails, same line of code?</li>
  <li><p>Inside of the groovy script, I have this
  .</p>
  
  <blockquote>
  <pre><code>node ("HOST_158") {
      git poll: true, credentialsId: 'id-id-id-id-id', url: 'https://example.com/buildbot/a_tests.git'
      sleep 1
  </code></pre>
  </blockquote></li>
  </ul>