openconnect-7.07-mimic-pulse-client.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 4ce9c9241f5707917e87e93a055f757cea5fb84d Mon Sep 17 00:00:00 2001
  2. From: Jon DeVree <nuxi@vault24.org>
  3. Date: Mon, 19 Sep 2016 21:00:18 -0400
  4. Subject: [PATCH] Add Content-Length header to mimic official pulse client
  5. The official pulse client sends in a fixed "Content-Length: 256" header
  6. with these two HTTP requests. Some versions of the VPN server will
  7. reject requests with an HTTP 400 error if they do not have this header.
  8. Signed-off-by: Jon DeVree <nuxi@vault24.org>
  9. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  10. ---
  11. oncp.c | 2 ++
  12. 1 file changed, 2 insertions(+)
  13. diff --git a/oncp.c b/oncp.c
  14. index cc9a223..2bf1571 100644
  15. --- a/oncp.c
  16. +++ b/oncp.c
  17. @@ -562,6 +562,7 @@ int oncp_connect(struct openconnect_info *vpninfo)
  18. buf_append(reqbuf, "POST /dana/js?prot=1&svc=1 HTTP/1.1\r\n");
  19. oncp_common_headers(vpninfo, reqbuf);
  20. + buf_append(reqbuf, "Content-Length: 256\r\n");
  21. buf_append(reqbuf, "\r\n");
  22. if (buf_error(reqbuf)) {
  23. @@ -606,6 +607,7 @@ int oncp_connect(struct openconnect_info *vpninfo)
  24. buf_truncate(reqbuf);
  25. buf_append(reqbuf, "POST /dana/js?prot=1&svc=4 HTTP/1.1\r\n");
  26. oncp_common_headers(vpninfo, reqbuf);
  27. + buf_append(reqbuf, "Content-Length: 256\r\n");
  28. buf_append(reqbuf, "\r\n");
  29. if (buf_error(reqbuf)) {
  30. --
  31. 2.7.3