Commit Graph
39 Commits
Author SHA1 Message Date
Tomas WeinfurtandTomas Weinfurt 5bb755d65e remove ClientAsyncAuthenticate_SslStreamClientServerNone_UseStrongCryptoSet (#37692)
Co-authored-by: Tomas Weinfurt <[email protected]>
2020-06-10 05:43:44 -04:00
Tomas Weinfurt ecc310bfc4 allow access to crypto props from RemoteCertificateValidationCallback (#37580) 2020-06-08 23:56:41 -07:00
Tomas WeinfurtandTomas Weinfurt ebc55e399b fix handling of Ssl2 and enable disabled tests (#36098)
* attempt to fix ssl2

* adjust length calculation

* enable tests

* fix ReadAsyncInternal

* use PlatformDetection.SupportsSsl2

* feedback from review

Co-authored-by: Tomas Weinfurt <[email protected]>
2020-05-19 13:42:11 -07:00
Tomas WeinfurtandTomas Weinfurt 8b02df8dac increase FailingTestTimeoutMiliseconds for Ssl server tests. (#36101)
* increase FailingTestTimeoutMiliseconds

* use standard ITestOutputHelper helper

* set timeout to to 500ms

* rework protocol mismatch

Co-authored-by: Tomas Weinfurt <[email protected]>
2020-05-09 08:57:20 -04:00
Tomas WeinfurtandTomas Weinfurt 3b68eb3b1e disable sslv2 tests for now (#36102)
Co-authored-by: Tomas Weinfurt <[email protected]>
2020-05-08 09:21:56 -04:00
Tomas WeinfurtandTomas Weinfurt 3058899348 improve handling of handshake failure (#35549)
* improve handling of handshake failure

* more cleanup

* remove console reference

* add quotes around parameter

* enable ServerAsyncAuthenticate_MismatchProtocols_Fails

* cleanup ssl2 test

* fix http2

* feedback from review

* add back two missing empty lines

Co-authored-by: Tomas Weinfurt <[email protected]>
2020-05-07 13:46:43 -07:00
Tomas Weinfurt 35c27fb79a propagate TLS alerts from OS layers (dotnet/corefx#41967)
* initial alerts with openssl

* get alerts from schannel

* update tests to work with openssl 1.1.x

* fix ClientAsyncAuthenticate_ServerNoEncryption_NoConnect to work properly with Tls13

* remove extra comment

* feedback from review

* feedback from review

* remove unused variable


Commit migrated from https://github.com/dotnet/corefx/commit/784cb6b5b7e947d3a69c7183847652a0e9335ff0
2019-11-13 13:50:57 -08:00
Krzysztof WicherandJeremy Barton eacb98e39a Debian 10/Win8.1 fixes: Allow explicitly using SSLv3, TLS1.0/1.1 (dotnet/corefx#39579)
* debian 10 fixes

* Fix Windows 8.1 (product issue)

* expand SSL_CTX_set_min/max_proto_version macro in attempt to fix the build

* define SSL_CTRL_SET_MIN/MAX_PROTO_VERSION when not defined

* Apply Win8.1 fix to all platforms in attempt to fix OSX

* check if failing test with excluded SSL2 passes on OSX

* Filter out incompatible protocols at the source instead of each callsite

* Remove ResetProtocolRestrictions from header file

* Update src/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs

Co-Authored-By: Jeremy Barton <[email protected]>

* revert files with only whitespace changes


Commit migrated from https://github.com/dotnet/corefx/commit/d5b91dc5e2b1c4bc73c4ba2070fd7cb8f7013b49
2019-07-26 16:43:12 -07:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
Stephen Toub 1de0f651e4 Improve StaticTestGenerator and fix some visibility (dotnet/corefx#36472)
Worked through a bunch of additional assemblies and fixed cases where StaticTestGenerator was doing the wrong thing.  Also fixed the visibility on a bunch of test methods it wasn't able to access.

Commit migrated from https://github.com/dotnet/corefx/commit/475542441df2f054d5e9aa39576019775a5d2f52
2019-03-29 17:40:05 -04:00
David Shulman 37a8a77744 Update tests for System.Net (dotnet/corefx#29875)
Re-enabling client certificate authentication tests for System.Net.Security. These tests
appear to be passing for a while now. Will monitor the tests to see if anything regresses.

Updated Ping tests to permanently skip them for UAP. Due to Windows OS limitations in the
Win32 APIs for ping, the .NET Ping class is not supported for UWP apps.

Fixes dotnet/corefx#16534
Fixes dotnet/corefx#19583

Commit migrated from https://github.com/dotnet/corefx/commit/3b665d55700b67d01f8da268096f55deb2facc6f
2018-05-23 12:13:18 -07:00
Stephen Toub 6c551076f0 Make default SocketsHttpHandler SslProtocols include Tls11/12 on Win7/2008R2 (dotnet/corefx#28788)
Windows 7 and Windows 2008 R2 support TLS 1.1 and 1.2, but for legacy reasons by default those protocols are not enabled when a developer elects to use the system default.  However, in .NET Core 2.0 and earlier, HttpClientHandler would enable them, due to being a wrapper for WinHTTP, which enabled them.  Both for compatibility and because we prefer those higher protocols whenever possible, SocketsHttpHandler also pretends they're part of the default when running on Win7/2008R2.

Commit migrated from https://github.com/dotnet/corefx/commit/0c7a1de0448c9dee76723d0bedd90f76c3436662
2018-04-04 09:59:09 -07:00
Stephen Toub fd20c03b0c Stop blocking explicit opt-in to Ssl2/3 in SslStream and HttpClient (dotnet/corefx#28639)
By default, .NET Core defaults to allowing TLSv1, TLSv1.1, and TLSv1.2.  However, whereas .NET Framework allows a developer to opt-in to SSLv2/SSLv3, .NET Core currently blocks it.  This means developers are unable to use .NET Core when they need to communicate with an endpoint they don't control and that's unfortunately limited to one of these protocols, which blocks adoption of .NET Core.

This commit stops blocking these protocols.  They're still disabled by default, and compiling against them still results in a deprecation warning, but if a developer chooses to ignore the warning and explicitly sets SslProtocols, they are at least able to use the protocols, subject to whatever the underlying operating system allows (e.g. Windows stops supporting SSLv2 as of v1607).

Commit migrated from https://github.com/dotnet/corefx/commit/3cc6fda0c6abe76eea222c165ebdf816e83df564
2018-03-30 22:00:37 -07:00
Caesar Chen ed27fff6d1 Use SCH_USE_STRONG_CRYPTO with SystemDefaults (dotnet/corefx#27382)
* Use SCH_USE_STRONG_CRYPTO with SystemDefaults

* address feedback

* fix comment


Commit migrated from https://github.com/dotnet/corefx/commit/ac46f5646ea97e3d337d68ebc3ac39652d4929a5
2018-02-25 20:44:11 -08:00
Cristian Pop 1b4936b8e9 Enabling System.Net.Security tests and fixing/disabling tests that currently fail in UAP / UAPAOT (dotnet/corefx#21283)
* Adding mutex workaround, temporary workaround for behavior differences in UAP.

* Disabling some tests in UAPAOT as they require an AppContainer


Commit migrated from https://github.com/dotnet/corefx/commit/8dd8794a65d11903cf75830f69c597109cf499d0
2017-06-20 19:03:20 -07:00
Alex Perovich 9a99fe0e8e Disable S.Net.Security tests that crash xunit on AoT (dotnet/corefx#19380)
Commit migrated from https://github.com/dotnet/corefx/commit/427a5380478cc27847b167d0217a93691c369e5d
2017-05-04 18:46:20 -07:00
Ian Hays 1152cc0cb5 Disable more recently failing Net.Security tests.
Commit migrated from https://github.com/dotnet/corefx/commit/b98081dd5a335b4c63ac39a25013b4bbccd07b23
2017-03-14 12:05:19 -07:00
Ian Hays 6e07e2c2c4 Disable some more netsec failing tests.
We've got some new failures in Net.Security from the same known issues. One of these was recently re-enabled to test a solution.


Commit migrated from https://github.com/dotnet/corefx/commit/341c654491852ee006a63f1effbcf1875c09b462
2017-03-10 13:16:00 -08:00
Ian Hays 28d7fb4255 System.Net.Security tests fix
Disables a few tests that are failing for known issues and increases the timeout on some tests that are failing on Unix because they're hitting that timeout.


Commit migrated from https://github.com/dotnet/corefx/commit/d1f06830400da29693d608974944ef8e3695c562
2017-03-07 13:48:55 -08:00
Ian Hays 647582dbc8 Disable tests with known recurring failures.
These all have the same root cause and fail in the same manner. We should disable them until we can resolve that root cause.


Commit migrated from https://github.com/dotnet/corefx/commit/297f459f705240b8be3ea834b1777d46ced391d6
2017-03-01 12:43:26 -08:00
Ian Hays 224978cba4 Test cleanup for System.Net.Security (dotnet/corefx#15952)
* Test cleanup for System.Net.Security

dotnet/corefx#3144 - Removed TODO because Begin/End were added back in dotnet/corefx#8358 and the issue is closed
dotnet/corefx#7825 - Original issue from April 2016. Cannot repro today. Re-enabling to watch for future failures.
dotnet/corefx#11170 - Can't repro failures on multiple OSs. Re-enabling to watch for future failures.
dotnet/corefx#11345 - Outerloop tests are passing and stable for thousands of iterations. Tentatively moving to innerloop to watch for potential future failures.
dotnet/corefx#12107 - removed TODO because issue is closed
dotnet/corefx#9130, dotnet/corefx#10909, dotnet/corefx#11624, dotnet/corefx#14177, dotnet/corefx#14505 - duplicate issues failing because of an intermittent error (remote party closed transport stream) not exclusive to the test which occurs in Outerloop runs for other NetSecurity tests. Re-enabling them and leaving them in innerloop to get more data.
dotnet/corefx#8744, dotnet/corefx#12683, dotnet/corefx#12706, dotnet/corefx#12728 - duplicate issues failing because of an intermittent error (credentials package not recognized) not exclusive to the test which occurs in Outerloop runs for other NetSecurity tests. Re-enabling them and leaving them in innerloop to get more data.

* Remove unused netsecurity tests helper

* Remove unused test helper


Commit migrated from https://github.com/dotnet/corefx/commit/02b0fdb699dfc03fd995d278d90f396892095590
2017-02-09 12:39:08 -08:00
Jon Hanna bbab2fef61 Fix typos suport → support
Mostly comments, private members and test names where they have
no effect, but one is in an exception message.


Commit migrated from https://github.com/dotnet/corefx/commit/26878cc7155b6e2b15b1d81606496093d9888084
2016-11-25 01:00:22 +00:00
David Shulman 935520c1dc Disable most networking tests for default CI runs
Lately, the CI system and test server infrastructure has been overloaded with many PRs. This is causing many networking tests to randomly fail due to resource exhaustion caused by so many simultaneous PR runs on the same CI machines. This occurrs not only when using an external test server endpoint (corefx-net.cloudapp.net) but also loopback servers.

To improve engineering efficiency for the team, we are moving most of the tests in the networking libraries from the default CI runs (innerloop). For developers working on networking libraries, the networking tests can be run by invoking the "outerloop" tests.

We will not be allowing any merges of PRs in the networking libraries unless the outerloop tests are also run by the developer.

This affects tests in the following libraries right now:

* System.Net.Http
* System.Net.Http.WinHttpHandler
* System.Net.Sockets
* System.Net.Security
* System.Net.WebSockets.Client

I will be working on fine tuning these exclusions (issue dotnet/corefx#11345) to try to bring back tests into the innerloop runs when we have begun to address the infrastructure issues.


Commit migrated from https://github.com/dotnet/corefx/commit/defbb8afd11b317f6b5cc2f4422a03d701b6dba3
2016-09-01 11:23:40 -07:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
Cristian Pop 60e09ea41b Merge pull request dotnet/corefx#5852 from CIPop/snstest
Test fixes for System.Net.Security

Commit migrated from https://github.com/dotnet/corefx/commit/4cd21f31004ca7205a5789fe22b334242ab766fc
2016-02-09 13:07:34 -08:00
Cristian Pop 01d61b736f Fixing and adding tests for the in-memory VirtualNetwork/Stream. Adding
TaskTimeoutExtensions and fixing the System.Net.Security timeout pattern.


Commit migrated from https://github.com/dotnet/corefx/commit/27954497d635ff0f01fbb16e1b485156c51398ea
2016-02-08 16:02:01 -08:00
stephentoub 53f90194de Remove Client property from TcpClient and UdpClient
The property leaks through the abstraction.  It's rarely used.  And it complicates things on Unix due to exposing the underlying socket instance combined with difficulties with multiple connect calls on a single socket instance.

Until we have good reason to expose it in the contract, we're removing it from the contract before it's stable.


Commit migrated from https://github.com/dotnet/corefx/commit/30abd30421289509cd3bd18a9114501afdc0fb7c
2016-02-07 10:40:27 -05:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Stephen Toub d3bec923b6 Enable System.Net.Security tests on OS X
Commit migrated from https://github.com/dotnet/corefx/commit/b75bcefbae1f1a650224869773fb2bff650dbced
2016-01-25 22:37:01 -05:00
dotnet-bot 8f7e954343 Porting NegotiateStream.
Commit migrated from https://github.com/dotnet/corefx/commit/9a414b0af4230b59a06dd9e255a36400582f482e
2016-01-08 16:51:31 -08:00
Cristian Pop 40dcf58810 Removing SSLv2 and SSLv3 support from System.Net.Security.
APIs will throw NotSupportedException if SSLv2 or v3 is used. This
behavior is different from .NET Desktop.
Tests have been changed to pin this new behavior.
Increased passing-test timeouts to 15s.

Fix dotnet/corefx#3114 (partial), dotnet/corefx#4467


Commit migrated from https://github.com/dotnet/corefx/commit/1f4deea8946d2e54dfd3c88e64c85bc3c3d9805c
2015-11-16 11:26:00 -08:00
stephentoub ab1f4c8fe8 Disable three System.Net.Security tests that repeatedly timeout
Commit migrated from https://github.com/dotnet/corefx/commit/59c9f299fba30a2ac3ca328d3013c70ca28bb1f5
2015-11-15 19:26:25 -05:00
Shruti Garg 0390074a73 Fixing System.Net.Security test failures in OS X
Commit migrated from https://github.com/dotnet/corefx/commit/15b2d692c05619da3350d5f0ed2a26002ea6c646
2015-11-06 17:39:48 +05:30
stephentoub 0bb85f778a Fix 43 of the 44 failing System.Net.Security tests on Linux
- System.Net.Sockets removed a bunch of APIs.  They're somehow still in the contracts, so compilation succeeds, but they're not implementation, so the tests fail when trying to use methods like TcpClient.Connect and various Begin/End methods.  I've changed these to use the appropriate Async methods.
- SslStream has a Debug.Fail which has been failing regularly, but it wasn't being noticed.  Now that Debug.Fail will throw an exception, the tests that were previously asserting are now failing.  I've temporarily commented out the Debug.Fail with a TODO comment.

One test is still failing:
```
System.Net.Security.Tests.ClientAsyncAuthenticateTest.ClientAsyncAuthenticate_MismatchProtocols_Ssl2_Fails_Linux(server: Ssl2, client: Tls11, expected: typeof(System.Security.Authentication.AuthenticationException)) [FAIL]
      Assert.Throws() Failure
      Expected: typeof(System.Security.Authentication.AuthenticationException)
      Actual:   typeof(System.InvalidOperationException): EndAuthenticate can only be called once for each asynchronous operation.
      Stack Trace:
            at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
            at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
```


Commit migrated from https://github.com/dotnet/corefx/commit/c0aab82ea70453324f5e7d51902a0e1bb40db365
2015-11-04 21:31:26 -08:00
Shruti Garg 23247f146b Resolved review comments
Commit migrated from https://github.com/dotnet/corefx/commit/2503efd50ecff681887246f6f2de8a20c1e6469a
2015-11-02 14:42:35 +05:30
Shruti Garg 70d782ce24 Enabling System.Net.Security tests in Linux
Commit migrated from https://github.com/dotnet/corefx/commit/a450fde974f7ff4514505b5b953af6deadae51ff
2015-10-30 15:47:37 +05:30
Cristian Pop 02282010cd Adding original SSPI object model back to the Windows SslStream implementation.
Commit migrated from https://github.com/dotnet/corefx/commit/863ae5dfcc36b66a599c6b022a88b02046b0d8a4
2015-10-14 14:36:57 -07:00
Stephen A. Imhoff 9f6e31a883 Remove custom error checking from System.Net.Security, per dotnet/corefx#516 .
- Remove .nuget.props for test project.


Commit migrated from https://github.com/dotnet/corefx/commit/9d7a7bdb5b56c33e48da1986be02e6b63c6360ee
2015-10-03 10:26:18 +09:00
dotnet-bot 779ca6dd2b Porting System.Net.Security
Commit migrated from https://github.com/dotnet/corefx/commit/c74b6f24070a11eb347a43d7ac6de3304a50e789
2015-09-16 11:17:12 -07:00