[GH-ISSUE #360] System.Net.WebException: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF #347

Closed
opened 2026-02-25 20:31:27 +03:00 by kerem · 1 comment
Owner

Originally created by @Hafnernuss on GitHub (Jun 14, 2022).
Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/360

Hi,

this happens when trying to connect to my (own) nextcloud instance.
It also happens when clicking the "Test or discover settings" in the configuration manager.
CalDav works on the server, at least syncing to android works without any issues.

Im grateful for any assistance you can provide.

CalDavSynchronizer.DataAccess.WebDavClientException: An error occurred while sending the request. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.<ExecuteWebDavRequest>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.<ExecuteWebDavRequestAndReadResponse>d__7.MoveNext()
   --- End of inner exception stack trace ---
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.<ExecuteWebDavRequestAndReadResponse>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.CalDavDataAccess.<GetVersions>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at CalDavSynchronizer.DataAccess.CalDavDataAccess.<GetVersions>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.Implementation.CalDavRepository`1.<GetAllVersions>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GenSync.EntityRepositories.VersionAwareToStateAwareEntityRepositoryAdapter`4.<GetFullRepositoryState>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GenSync.Synchronization.Synchronizer`11.<Synchronize>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GenSync.Synchronization.ContextCreatingSynchronizerDecorator`7.<Synchronize>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.Scheduling.SynchronizationProfileRunner.<RunAndRescheduleNoThrow>d__22.MoveNext()
Originally created by @Hafnernuss on GitHub (Jun 14, 2022). Original GitHub issue: https://github.com/aluxnimm/outlookcaldavsynchronizer/issues/360 Hi, this happens when trying to connect to my (own) nextcloud instance. It also happens when clicking the "Test or discover settings" in the configuration manager. CalDav works on the server, at least syncing to android works without any issues. Im grateful for any assistance you can provide. ``` CalDavSynchronizer.DataAccess.WebDavClientException: An error occurred while sending the request. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.<ExecuteWebDavRequest>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.<ExecuteWebDavRequestAndReadResponse>d__7.MoveNext() --- End of inner exception stack trace --- at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.<ExecuteWebDavRequestAndReadResponse>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.DataAccess.CalDavDataAccess.<GetVersions>d__29.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at CalDavSynchronizer.DataAccess.CalDavDataAccess.<GetVersions>d__29.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.Implementation.CalDavRepository`1.<GetAllVersions>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GenSync.EntityRepositories.VersionAwareToStateAwareEntityRepositoryAdapter`4.<GetFullRepositoryState>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GenSync.Synchronization.Synchronizer`11.<Synchronize>d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GenSync.Synchronization.ContextCreatingSynchronizerDecorator`7.<Synchronize>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CalDavSynchronizer.Scheduling.SynchronizationProfileRunner.<RunAndRescheduleNoThrow>d__22.MoveNext() ```
kerem closed this issue 2026-02-25 20:31:27 +03:00
Author
Owner

@aluxnimm commented on GitHub (Jun 24, 2022):

The server sends invalid headers. Enable the general option Enable useUnsafeHeaderParsing.

<!-- gh-comment-id:1165488363 --> @aluxnimm commented on GitHub (Jun 24, 2022): The server sends invalid headers. Enable the general option Enable useUnsafeHeaderParsing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/outlookcaldavsynchronizer#347
No description provided.