We have several innerloop tests that make HTTP calls during System.Net.Http.Functional.Tests out to www.ssllabs.com, which has SSL endpoints for different SSL protocols. This commit avoids using that server during innerloop tests. The tests are moved to outerloop, and some replacements using a localhost are added to innerloop.
Commit migrated from https://github.com/dotnet/corefx/commit/8a9402b33d46166d1a3129a7c2cae0334b00c4b6
If an SSL operation fails, we call SSL_get_error to determine how to proceed.
SSL_get_error's logic is, essentially
libcrypto_error ?? WANT_READ ?? WANT_WRITE ?? WANT_X509 ?? panic
This means that if a previous call into libcrypto on the same thread had left
something in the error queue when the operation goes into the WANT_READ state (etc)
SSL_get_error will report that the request must have failed due to something in
libcrypto.
There are two different fixes being done here:
1) PKCS12_parse is a known contributor to this problem, clear out the queue on a
successful exit.
2) Before any SSL stream operation (handshake, read, write, shutdown) clear the
queue, in case there are other functions which are leaving dangling errors.
With those mitigations in place, the intermittent errors seen during SslStream
usage should hopefully be a thing of the past.
Commit migrated from https://github.com/dotnet/corefx/commit/80a53ed415ece115d15bcf519e81e600362fd3dc
We currently make a lot of calls off-box in our unit tests. By adding SSL support to the loopback server, we should be able to convert many more tests to avoid needing to actually hit the network. This adds such basic support, and converts a few tests to use it.
Also, since I was moving the certificate configuration code to a central location, I fixed an issue related to cleanup.
Commit migrated from https://github.com/dotnet/corefx/commit/b90795e1d5d7e8d8c68b9ca23d53b1ba0e392f46
Add CurlHandlers.SslProtocols option
With libcurl on the OpenSSL backend (the recommended configuration), we can provide full-fidelity for this option. With libcurl on another SSL backend, we can allow choosing all three TLS protcols or just one TLS protocol, but we can't support selecting two of the three.
Commit migrated from https://github.com/dotnet/corefx/commit/bd79e80f25923e0f2e29e07aba60b03070596bb4