Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

all http auth not working when using apache (eg git clone) #42

Closed
linc01n opened this issue Nov 7, 2014 · 2 comments · Fixed by #45
Closed

all http auth not working when using apache (eg git clone) #42

linc01n opened this issue Nov 7, 2014 · 2 comments · Fixed by #45

Comments

@linc01n
Copy link
Collaborator

linc01n commented Nov 7, 2014

Reproduce steps:

using the following Vagrantfile changes

 chef.json = {
      'java' => {
        'install_flavor' => 'oracle',
        'java_home' => '/usr/lib/jvm/java-7-oracle',
        'jdk_version' => '7',
        'oracle' => {
          'accept_oracle_download_terms' => true
        }
      },
      'mysql' => {
        'server_root_password' => 'iloverandompasswordsbutthiswilldo',
        'server_repl_password' => 'iloverandompasswordsbutthiswilldo',
        'server_debian_password' => 'iloverandompasswordsbutthiswilldo'
      },
      'stash' => {
        "apache2" => {
          "virtual_host_name" => "stash-centos-http",
          "virtual_host_alias" => "stash-centos-http",
          "prefork" => {
            "serverlimit" => 20,
            "maxclients" => 20,
            "maxrequestsperchild" => 400
          }
        }
      }
    }
    chef.run_list = [
      'recipe[java]',
      'recipe[rsync]',
      "recipe[#{cookbook}]",
      'recipe[stash::backup_client]',
      'recipe[stash::apache2]'
    ]

Add 192.168.50.10 stash-centos-http to /etc/hosts

And run vagrant up centos6

Create a repo on https://stash-centos-http

When you do a git clone -c http.sslVerify=false https://lincoln@stash-centos-http/scm/test/test.git

replace lincoln with your username

It will give you fatal: Authentication failed for 'https://lincoln@stash-centos-http/scm/test/test.git/'

But when I did a revert on webapp.conf.erb

diff --git a/templates/default/web_app.conf.erb b/templates/default/web_app.conf.erb
index fb3d947..edae4b1 100644
--- a/templates/default/web_app.conf.erb
+++ b/templates/default/web_app.conf.erb
@@ -18,9 +18,6 @@
    ErrorLog <%= node['stash']['apache2']['error_log'].empty? ? node['apache']['log_dir']+"/stash-error.log" : node['stash']['apache2']['error_log'] %>
    LogLevel warn

-    # Make sure we disable/prevent basic authentication attempts since Stash 2.1+ can't handle them
-    RequestHeader unset Authorization
-
    <Proxy *>
     <% if node['apache'] && node['apache']['version'] == '2.4' %>
        Require all granted
@@ -49,9 +46,6 @@
    ErrorLog <%= node['stash']['apache2']['ssl']['error_log'].empty? ? node['apache']['log_dir']+"/stash-ssl-error.log" : node['stash']['apache2']['ssl']['error_log'] %>
    LogLevel warn

-    # Make sure we disable/prevent basic authentication attempts since Stash 2.1+ can't handle them
-    RequestHeader unset Authorization
-
    <Proxy *>
     <% if node['apache'] && node['apache']['version'] == '2.4' %>
        Require all granted

Then git clone works perfectly.

Affected features:

All API required auth and git operation which use http protocol.

It is related to #36

@legal90
Copy link
Contributor

legal90 commented Dec 12, 2014

I have the same issue.

RequestHeader unset Authorization

@linc01n, commenting this line really helps, thank you!

@legal90
Copy link
Contributor

legal90 commented Dec 12, 2014

Seems like #36 should be reverted

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants