* [System]: Make HttpListener partial and move Mono-specific bits into HttpListener.Mono.cs.
* Remove ancient EMBEDDED_IN_1_0 conditional.
* Remove unused using statements.
* HttpListener.CreateSslStream() now uses RemoteCertificateValidationCallback.
* [Mono.Security.Interface]: Improve synergy between `MonoTlsProvider`, `SslStream` and `IMonoSslStream`.
* Add `IMonoSslStream.SslStream` property; the `IMonoSslStream` is now only created my the `SslStream`
constructor, so `SslStream` "owns" the `IMonoSslStream`.
* Add internal `MonoTlsProvider.CreateSslStreamInternal()`.
* `SslStream` does not need to implement any additional interfaces; we can do without after
getting rid of the wrapper classes.
* Add internal `SslStream.CreateMonoSslStream(Stream,bool,MonoTlsProvider,MonoTlsSettings)`.
* `MonoTlsProvider.CreateSslStream()` implementations should use this new method.
* Remove ancient obsolete MonoTlsProviderFactory APIs.
* `HttpListener` and `HttpConnection` now use `SslStream` instead of `IMonoSslStream`.
* [System]: Cleanup internal TLS Provider registration.
* Make it build.
The use of HttpResponseMessage.ReasonPhrase means:
* marking the HttpListenerResponse.GetStatusDescription method;
* marking the HttpListenerResponse type;
* which implements IDisposable, so it's Dispose method is marked
* marking the Close method...
from there a metric ton of code gets recursively marked to the point
where the whole SSL/TLS server code gets inside the app.
To avoid this we move the GetStatusDescription to a different
type that won't bring the end of the civilized world so fast.
The problem is connected with "Listener" property of "context" object. It is null in "GetResponseStream" method, when it's called internally from "FinishInitialization" method of "HttpListenerRequest" class. This problem is possible only in situation when we have "Expect: 100-Continue" header from http client.
This change is released under the MIT license.
This new method lets you create a 'HttpListener' and specify the X509Certificate2 to use
(so you don't have to put it into ~/.config/.mono/httplistener) as well as an optional
'MonoTlsProvider' and optional 'MonoTlsSettings'.
A continue statement in a do...while loop was skipping code to read the next line in a connection, causing an infinite loop.
Fixed by refactoring the loop, removing duplicated code.
This patch builds upon commit 96a8500795 which placed parts of Mono.Security
responsible for dealing with SSL/TLS certificates for the purpose of certificate verification. The code enables
validation of the certifcates even if the user does not provide their own validation callback. The changes as related to
the original commit are few, basically consisting of enabling the same code used by MonoTouch in the MonoDroid context with
the only actual code change being the certificate validation bit mentioned above.
Since the change involves adding a subset of Mono.Security files to the monodroid version of System.dll, it is
also necessary to remove Mono.Android's dependence on Mono.Security.dll. The reason is that the code in AndroidPlatform
which looks up TLS support methods in Mono.Android.dll would use a type (X509CertificateCollection) that is now part of
System.dll but is *also* in Mono.Security.dll referenced by Mono.Android.dll and therefore the lookup would fail since
we'd have two distinct types from the reflection point of view.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=18962
Idle connections that never received any data or had ever been
associated to a listener are properly closed now when the endpoint is
closed or the last listener they used is closed.
Fixes a bunch of tests in System.ServiceModel.
Use a timer to handle read timeouts and extend reuses to regular
connections, not just chunked. The timer is set to 90s for the first
request and 15s for subsequent requests.
* HttpListener.cs:
* HttpListenerRequest.cs:
* ListenerAsyncResult.cs:
* HttpConnection.cs: make sure there is no pending input when reusing
the connection.
svn path=/trunk/mcs/; revision=153300
* HttpListenerRequest.cs: add the right status code.
* HttpConnection.cs: exception might come from more places when
reading the input. Catch all of them.
svn path=/trunk/mcs/; revision=142004
* HttpConnection.cs: we were not writing the headers for 0-length
responses.
* WebConnectionStream.cs: for 204/304 responses with an explicit
content-length of 0, release the socket only once.
Fixes bug #465638.
svn path=/trunk/mcs/; revision=123250
* HttpConnection.cs: remove CWL. When reusing, BeginReadRequest might
throw if the client closes.
* HttpListenerResponse.cs: close the connection for 1.0 clients.
svn path=/trunk/mcs/; revision=119225
* HttpConnection.cs:
* HttpListenerResponse.cs: fix typo that caused the "connection close"
header to be sent. Do not close the socket when the encoding is not
chunked and reuse is possible.
Fixes bug #433371.
svn path=/trunk/mcs/; revision=115250
* HttpListenerPrefixCollection.cs, EndPointListener.cs,
HttpListener.cs, EndPointManager.cs, HttpConnection.cs: Remove
generics support where necessary to allow this code to be reused
in the 1.0 profile.
svn path=/trunk/mcs/; revision=112922