具有身份验证的Squid代理不返回响应

时间:2016-04-19 04:35:20

标签: authentication proxy squid

我正在尝试使用Squid设置代理服务器,该服务器与外部服务器连接以进行身份​​验证。我们已经配置并设置了Squid和一个程序来执行身份验证,但是当我们尝试对它进行测试时,我们得不到任何响应 - 不是错误,也不是OK响应或任何内容。

我们还没有通过外部服务器测试正确的身份验证,但是我们正在测试的文件中的用户名列表应该返回响应。我们已经在服务器上的命令行上使用那些服务器测试了身份验证程序,并且它返回了正确的响应,因此我们怀疑问题出在squid.conf文件中,但我们几乎可以确定这是正确的配置

这是相关的squid.conf;

auth_param basic program /path/to/AuthClient/dist/build/AuthClient/AuthClient
auth_param basic realm proxy

acl ip1 src Address1 #ommitting the actual IP addresses but these are the correct ones.
acl ip2 src Address2    
acl authdetails proxy_auth REQUIRED

acl Safe_ports port 1-65535

http_access !Safe_ports
http_access allow authdetails ip2

http_access deny all

http_port proxy.ip.address.here:3128

# Some code below to enable inserting banners into the users websites - probably not relevant but I'm not sure so I left it in.
icap_enable on

icap_service service_req reqmod_precache bypass=1 icap://127.0.0.1:1344/request
adaptation_access service_req allow all

icap_service service_resp respmod_precache bypass=0 icap://127.0.0.1:1344/response
adaptation_access service_resp allow all

作为参考,这里是Authclient的主要部分,它是用Haskell编写的,它应该处理身份验证。我们认为问题在于squid.config,但它包含在内以防万一。

Module Main where

import Control.Applicative

import System.Environment
import System.IO

import Control.Monad

getPeople = map words . lines <$> getContents

main = getPeople >>= authUsers

authUsers :: [[String]] -> IO ()
authUsers ([user,pass]:xs) = do
    res <-  if user `elem` userlist then return "OK" else return "ERR" 
    appendFile "/tmp/authtest" ("Got request from " ++ user ++" with " ++ res ++"\n")
    putStrLn res
    authUsers xs
authUsers (_:xs) = putStrLn "ERR" >> authUsers xs
authUsers _ = return ()
userlist = #There is a userlist here.

我们不确定出了什么问题,尽管它可能在squid.conf中。任何帮助或建议将不胜感激。提前谢谢!

0 个答案:

没有答案
相关问题