This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SAVDID : "ICAP/1.0 505 Unsupported protocol or version "

Hi

We are integrating our application with SAVDID and the SAVDID is throwing an error "ICAP/1.0 505 Unsupported protocol or version ". Below is the RESPMOD Request:

RESPMOD icap://localhost:1344/AVSCAN?action=SCAN ICAP/1.0

Host: localhost:1344

Preview: 4

Allow: 204

Encapsulated: req-hdr=0 res-hdr=83 res-body=130

GET localhsot/C:\Users\prasad\Downloads\eicar.com.txt HTTP/1.1Host: localhost
HTTP/1.1 200 OKTransfer-Encoding: chunked


4  

[Preview four bytes of data]

0

If we send only options message as below we get the proper response.

Sent:

OPTIONS icap://localhost:1344/avscan ICAP/1.0 

Host localhost

Received:

ICAP/1.0 200 OKIS

Tag: "1-01-3-26-28-FDADC8A5"

Service: Sophos Anti-Virus SAVDI/ICAP

Date: Wed, 14 Dec 2011 08:05:05 GMT

Methods: RESPMOD

Transfer-Complete: *

Options-TTL: 3500Encapsulated: null-body=0

Any help is appreciated. Thanks

:19783


This thread was automatically locked due to age.
  • Hi,

    Does it work without the preview being set?

    AVSCAN being upper case should be ok as it seems to be a case insensitive match against the service name, i.e. avscan.

    Also, do you get this problem on the first message sent to the service?  I.e. if you restart the service and send the problem query does it work.  Again try it without the preview as the first message?

    Regards,

    Jak

     

    :19795
  • Hi jak,

    Thanks for your suggestions.

    I tried restarting the service and sending the RESPMOD query as the first message but getting the same error.  Also tried sending the query without "Preview" but getting the same error again. 

    Is the RESPMOD query I am sending in correct format?

    Regards,

    Prasad

    :19803
  • Ok, what about if the first query was:

    RESPMOD icap://localhost:1344/avscan ICAP/1.0

    rather than:
    RESPMOD icap://localhost:1344/AVSCAN?action=SCAN ICAP/1.0

    Also, would you be able to "Pastebin" and link your savdid.conf config file and possibly even a snippet of your code that constructs the first query, i.e.

    RESPMOD icap://localhost:1344/AVSCAN?action=SCAN ICAP/1.0

    Regards,

    Jak

    :19813
  • Hi Jak,

    I have tried the query as suggested, still getting the same result. I do not know how to attach the files here, I have put them under my domain under the link:

    Client code: http://pravridh.co.in/Client.java

    SAVDID Conf: http://pravridh.co.in/savdid.conf

    Thanks in advance.

    :19871
  • Hi,

    The java differs from what is shown.

    The line:
    output.writeBytes(header + reqheader + resheader + "Content-Length: " +Long.toHexString(file_length) + "\r\n");


    has an extra Content-Length line. This line is not shown on his output and if present would mess things up. That line should be included in the resheader:-


    String resheader = "HTTP/1.1 200 OK\r\n" +"Transfer-Encoding: chunked\r\n" +"Content-Length: " + Long.toHexString(file_length) + "\r\n" + "\r\n";


    So the line above is simply

    output.writeBytes(header + reqheader + resheader);


    and followed by

    chunk = Long.toHexString(file_length) + "\r\n"output.writeBytes(chunk)output.writeBytes(file)output.writeBytes("\r\n0\r\n\r\n");


    The question is: where did that Content_Length come from?

    Was it always there and just not reported?

    Regards,

    Jak

    :19951
  • Hi Jak,

    The Content-Length line was not present when I posted the query, it is just that I have been searching in Google and trying to implement different things, I have posted the code with an extra line here.

    I have tried the code without Content-Length it still does not work for me. Is there additional configurations/ code that I have missed?

    Thanks.

    Prasad J N

    :20025
  • Hi,

    The Encapsulated header needs commas between the elements.  Without them the line isn’’’’t being recognised and the 505 error is a result of the GET / HTTP/1.1 line.

    The line should read:

    Encapsulated: req-hdr=0, res-hdr=32, res-body=76

    Can you try that.

    Regards,

    Jak

    :20111
  • Thanks Jak. Yes it was the commas missed in the Encapsulated header that was the problem.

    Appreciate your response.

    Prasad J N

    :20193
  • hi jak

    can you please provide sample java demo example for to call savdi service for file scannig?

    Thanks

    Yatin Baraiya

    :48112
  • Hi prasadjn

    can you provide me your sample file , we need it , if you not able to attched it, then plese send those files to my email id:yatin.baraiya@highq.com

    Client code: http://pravridh.co.in/Client.java

    SAVDID Conf: http://pravridh.co.in/savdid.conf

    we are very thankfull to you if you send those file to us,

    Thanks & Regards

    Yatin Baraiya

    :48168