Baekalfen / ICAP-avscan

Uploads a file to a ICAP server.
MIT License
47 stars 29 forks source link

McAfee Integration: Status Code 418 #14

Open charliefryer opened 5 years ago

charliefryer commented 5 years ago

Hi,

When trying to implement with a McAfee server, I am recieving error code 418 which I believe means my request is missing a required request header. I read the issue raised by sc06 and followed their advice (https://github.com/Baekalfen/ICAP-avscan/issues/8#issuecomment-362019517) modifying the request as follows:

ESPMOD icap://<I.P.>/RESPMOD ICAP/1.0 Host: <I.P.> X-Client-Abandon-Supported: 1 Preview: 30 X-Scan-Progress-Interval: 10 Allow: 204 Encapsulated: res-hdr=0, res-body=26

Content-Length: 572939

1e

I dont understand how sc06 created a request header. Is the following from their comment the request header?:

"GET /C:\TestFiles\test1.txt HTTP/1.1 Host: icap.health.check"

Why would that need to be sent? Do I need to make the file available on that host? Please forgive my lack of knowledge around the protocol.

Thanks very much for your help.

Charlie.

charliefryer commented 5 years ago

Hi,

I updated the request to specify an empty request header ie "Encapsulated: res-hdr=0, res-body="+resBody.length()+"\r\n"

I'm now getting an IOException Connection reset by peer: socket write error

I'll investigate to see if this is an issue on the server.

Thanks, Charlie.

Baekalfen commented 5 years ago

I've never had access to an McAfee server, so I don't know if my code is compatible.

The "GET ..." part from #8 would be the encapsulated HTTP request, but it seems confusing, when you cannot differentiate what the server and client says.

My code will be sending the file inside the datastream. So I cannot say for sure why the filepath is in the request.

If you find a solution, I will gladly update my code accordingly.

taoef1k commented 5 years ago

If this issue still occurs, you may try with the latest code, perhaps can work with it.

SalmanZafar214 commented 5 years ago

i have tired latest code but yet getting Server returned unknown status code:418 Scanning server is McAfee RESPMOD icap://192.168.3.27/avscan ICAP/1.0 Host: 192.168.3.27 User-Agent: IT-Kartellet ICAP Client/1.1 Allow: 204 Preview: 30 Encapsulated: res-hdr=0, res-body=26

Content-Length: 696416

1E\r\n"